diff --git a/sdk/face/azure-ai-vision-face/README.md b/sdk/face/azure-ai-vision-face/README.md index c324baf386ef1..f77624d3c0864 100644 --- a/sdk/face/azure-ai-vision-face/README.md +++ b/sdk/face/azure-ai-vision-face/README.md @@ -226,7 +226,7 @@ FaceSessionClient sessionClient = new FaceSessionClientBuilder() .buildClient(); String deviceCorrelationId = UUID.randomUUID().toString(); -CreateLivenessWithVerifySessionJsonContent parameters = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) +CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationId(deviceCorrelationId) .setSendResultsToClient(false); Path path = Paths.get(imagePathString); diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClientBuilder.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClientBuilder.java new file mode 100644 index 0000000000000..5e80ac1b584f6 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClientBuilder.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceAdministrationClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the FaceAdministrationClient type. + */ +@ServiceClientBuilder( + serviceClients = { + LargeFaceListClient.class, + LargePersonGroupClient.class, + LargeFaceListAsyncClient.class, + LargePersonGroupAsyncClient.class }) +public final class FaceAdministrationClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-vision-face.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the FaceAdministrationClientBuilder. + */ + @Generated + public FaceAdministrationClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private FaceServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the FaceAdministrationClientBuilder. + */ + @Generated + public FaceAdministrationClientBuilder serviceVersion(FaceServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the FaceAdministrationClientBuilder. + */ + @Generated + public FaceAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of FaceAdministrationClientImpl with the provided parameters. + * + * @return an instance of FaceAdministrationClientImpl. + */ + @Generated + private FaceAdministrationClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + FaceServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); + FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private 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 + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of LargeFaceListAsyncClient class. + * + * @return an instance of LargeFaceListAsyncClient. + */ + @Generated + public LargeFaceListAsyncClient buildLargeFaceListAsyncClient() { + return new LargeFaceListAsyncClient(buildInnerClient().getLargeFaceLists()); + } + + /** + * Builds an instance of LargePersonGroupAsyncClient class. + * + * @return an instance of LargePersonGroupAsyncClient. + */ + @Generated + public LargePersonGroupAsyncClient buildLargePersonGroupAsyncClient() { + return new LargePersonGroupAsyncClient(buildInnerClient().getLargePersonGroups()); + } + + /** + * Builds an instance of LargeFaceListClient class. + * + * @return an instance of LargeFaceListClient. + */ + @Generated + public LargeFaceListClient buildLargeFaceListClient() { + return new LargeFaceListClient(buildInnerClient().getLargeFaceLists()); + } + + /** + * Builds an instance of LargePersonGroupClient class. + * + * @return an instance of LargePersonGroupClient. + */ + @Generated + public LargePersonGroupClient buildLargePersonGroupClient() { + return new LargePersonGroupClient(buildInnerClient().getLargePersonGroups()); + } + + 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/FaceAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java index 74568baff2eac..7c04151c5fa0e 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 @@ -6,14 +6,18 @@ import com.azure.ai.vision.face.implementation.FaceClientImpl; import com.azure.ai.vision.face.implementation.models.DetectFromUrlImplOptions; import com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.FindSimilarFromLargeFaceListRequest; import com.azure.ai.vision.face.implementation.models.FindSimilarRequest; import com.azure.ai.vision.face.implementation.models.GroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromLargePersonGroupRequest; import com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest; 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.FaceFindSimilarResult; import com.azure.ai.vision.face.models.FaceGroupingResult; +import com.azure.ai.vision.face.models.FaceIdentificationResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; import com.azure.ai.vision.face.models.FaceVerificationResult; import com.azure.ai.vision.face.models.FindSimilarMatchMode; @@ -61,16 +65,8 @@ public final class FaceAsyncClient { * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the * faces created by Detect. * - * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. - * - * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it - * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find - * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. - * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is - * low. It can be used in the cases like searching celebrity-looking faces. - * - * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the - * target faceId array. + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * details. *

Request Body Schema

* *
{@code
@@ -114,13 +110,8 @@ public Mono> findSimilarWithResponse(BinaryData findSimilar
     /**
      * Verify whether two faces belong to a same person.
      *
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Higher face image quality means better identification precision. Please consider high-quality faces:
-     * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
-     * > * For the scenarios that are sensitive to accuracy please make your own judgment.
-     * > * The 'recognitionModel' associated with the both faces should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for
+     * more details.
      * 

Request Body Schema

* *
{@code
@@ -157,16 +148,7 @@ public Mono> verifyFaceToFaceWithResponse(BinaryData verify
     /**
      * Divide candidate faces into groups based on face similarity.
      *
-     * >
-     * *
-     * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have
-     * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice
-     * that faces belonging to a same person might be split into several groups in the result.
-     * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original
-     * faces. The messyGroup will not appear in the result if all faces found their counterparts.
-     * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you
-     * only have 2 candidate faces.
-     * * The 'recognitionModel' associated with the query faces' faceIds should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details.
      * 

Request Body Schema

* *
{@code
@@ -211,16 +193,8 @@ public Mono> groupWithResponse(BinaryData groupRequest, Req
      * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the
      * faces created by Detect.
      *
-     * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity.
-     *
-     * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it
-     * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find
-     * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds.
-     * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is
-     * low. It can be used in the cases like searching celebrity-looking faces.
-     *
-     * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
-     * target faceId array.
+     * 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.
@@ -255,16 +229,8 @@ public Mono> findSimilar(String faceId, 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.
      *
-     * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity.
-     *
-     * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it
-     * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find
-     * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds.
-     * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is
-     * low. It can be used in the cases like searching celebrity-looking faces.
-     *
-     * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
-     * target faceId array.
+     * 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.
@@ -292,13 +258,8 @@ public Mono> findSimilar(String faceId, List
     /**
      * Verify whether two faces belong to a same person.
      *
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Higher face image quality means better identification precision. Please consider high-quality faces:
-     * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
-     * > * For the scenarios that are sensitive to accuracy please make your own judgment.
-     * > * The 'recognitionModel' associated with the both faces should be the same.
+     * 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".
@@ -324,16 +285,7 @@ public Mono verifyFaceToFace(String faceId1, String face
     /**
      * Divide candidate faces into groups based on face similarity.
      *
-     * >
-     * *
-     * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have
-     * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice
-     * that faces belonging to a same person might be split into several groups in the result.
-     * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original
-     * faces. The messyGroup will not appear in the result if all faces found their counterparts.
-     * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you
-     * only have 2 candidate faces.
-     * * The 'recognitionModel' associated with the query faces' faceIds should be the same.
+     * 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.
@@ -363,45 +315,16 @@ public Mono group(List faceIds) {
     /**
      * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.
      *
-     * > [!IMPORTANT]
-     * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional
-     * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair
-     * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile,
-     * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible
-     * use case that would benefit from the use of any of the limited capabilities. Read more about this decision
-     * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/.
-     *
-     * *
-     * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an
-     * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face
-     * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call.
-     * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion,
-     * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific
-     * attributes may not be highly accurate.
-     * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
-     * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with
-     * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size.
-     * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small.
-     * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use
-     * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes).
-     * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer
-     * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model
-     * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model.
-     * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this
-     * detection model.
-     * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find
-     * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value
-     * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need
-     * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model.
-     * More details, please refer to
-     * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more
+     * details.
      * 

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -549,45 +472,15 @@ Mono> detectFromUrlImplWithResponse(BinaryData detectFromUr /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. *

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -732,38 +625,8 @@ Mono> detectImplWithResponse(BinaryData imageContent, Reque /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * 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. @@ -820,42 +683,13 @@ Mono> detectFromUrlImpl(DetectFromUrlImplOptions optio /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * 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 @@ -916,38 +750,7 @@ Mono> detectImpl(BinaryData imageContent, FaceDetectio /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. * * @param imageContent The input image binary. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1442,4 +1245,322 @@ public Mono> detect(String url, FaceDetectionModel det FaceRecognitionModel recognitionModel, boolean returnFaceId, List returnFaceAttributes) { return this.detect(url, detectionModel, recognitionModel, returnFaceId, returnFaceAttributes, null, null, null); } + + /** + * 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 verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromLargePersonGroupWithResponse( + BinaryData verifyFromLargePersonGroupRequest, RequestOptions requestOptions) { + return this.serviceClient.verifyFromLargePersonGroupWithResponseAsync(verifyFromLargePersonGroupRequest, + 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. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceList(String faceId, String largeFaceListId, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest findSimilarFromLargeFaceListRequestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData findSimilarFromLargeFaceListRequest = BinaryData.fromObject(findSimilarFromLargeFaceListRequestObj); + return findSimilarFromLargeFaceListWithResponse(findSimilarFromLargeFaceListRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar-from-large-face-list 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 largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceList(String faceId, String largeFaceListId) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest findSimilarFromLargeFaceListRequestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId); + BinaryData findSimilarFromLargeFaceListRequest = BinaryData.fromObject(findSimilarFromLargeFaceListRequestObj); + return findSimilarFromLargeFaceListWithResponse(findSimilarFromLargeFaceListRequest, 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. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group + * for more details. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroup(List faceIds, + String largePersonGroupId, Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest identifyFromLargePersonGroupRequestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData identifyFromLargePersonGroupRequest = BinaryData.fromObject(identifyFromLargePersonGroupRequestObj); + return identifyFromLargePersonGroupWithResponse(identifyFromLargePersonGroupRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group + * for more details. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroup(List faceIds, + String largePersonGroupId) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest identifyFromLargePersonGroupRequestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId); + BinaryData identifyFromLargePersonGroupRequest = BinaryData.fromObject(identifyFromLargePersonGroupRequestObj); + return identifyFromLargePersonGroupWithResponse(identifyFromLargePersonGroupRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 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. + * + * @param faceId The faceId of the face, come from "Detect". + * @param largePersonGroupId Using existing largePersonGroupId and personId for fast loading a specified person. + * largePersonGroupId is created in "Create Large Person Group". + * @param personId Specify a certain person in Large Person Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono verifyFromLargePersonGroup(String faceId, String largePersonGroupId, + String personId) { + // Generated convenience method for verifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromLargePersonGroupRequest verifyFromLargePersonGroupRequestObj + = new VerifyFromLargePersonGroupRequest(faceId, largePersonGroupId, personId); + BinaryData verifyFromLargePersonGroupRequest = BinaryData.fromObject(verifyFromLargePersonGroupRequestObj); + return verifyFromLargePersonGroupWithResponse(verifyFromLargePersonGroupRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_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 64c7b4c1386e0..0a95a95ff188a 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 @@ -6,14 +6,18 @@ import com.azure.ai.vision.face.implementation.FaceClientImpl; import com.azure.ai.vision.face.implementation.models.DetectFromUrlImplOptions; import com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.FindSimilarFromLargeFaceListRequest; import com.azure.ai.vision.face.implementation.models.FindSimilarRequest; import com.azure.ai.vision.face.implementation.models.GroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromLargePersonGroupRequest; import com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest; 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.FaceFindSimilarResult; import com.azure.ai.vision.face.models.FaceGroupingResult; +import com.azure.ai.vision.face.models.FaceIdentificationResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; import com.azure.ai.vision.face.models.FaceVerificationResult; import com.azure.ai.vision.face.models.FindSimilarMatchMode; @@ -59,16 +63,8 @@ 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. * - * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. - * - * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it - * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find - * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. - * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is - * low. It can be used in the cases like searching celebrity-looking faces. - * - * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the - * target faceId array. + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * details. *

Request Body Schema

* *
{@code
@@ -111,13 +107,8 @@ public Response findSimilarWithResponse(BinaryData findSimilarReques
     /**
      * Verify whether two faces belong to a same person.
      *
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Higher face image quality means better identification precision. Please consider high-quality faces:
-     * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
-     * > * For the scenarios that are sensitive to accuracy please make your own judgment.
-     * > * The 'recognitionModel' associated with the both faces should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for
+     * more details.
      * 

Request Body Schema

* *
{@code
@@ -154,16 +145,7 @@ public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceTo
     /**
      * Divide candidate faces into groups based on face similarity.
      *
-     * >
-     * *
-     * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have
-     * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice
-     * that faces belonging to a same person might be split into several groups in the result.
-     * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original
-     * faces. The messyGroup will not appear in the result if all faces found their counterparts.
-     * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you
-     * only have 2 candidate faces.
-     * * The 'recognitionModel' associated with the query faces' faceIds should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details.
      * 

Request Body Schema

* *
{@code
@@ -207,16 +189,8 @@ public Response groupWithResponse(BinaryData groupRequest, RequestOp
      * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the
      * faces created by Detect.
      *
-     * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity.
-     *
-     * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it
-     * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find
-     * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds.
-     * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is
-     * low. It can be used in the cases like searching celebrity-looking faces.
-     *
-     * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
-     * target faceId array.
+     * 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.
@@ -251,16 +225,8 @@ public List findSimilar(String faceId, List faceI
      * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the
      * faces created by Detect.
      *
-     * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity.
-     *
-     * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it
-     * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find
-     * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds.
-     * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is
-     * low. It can be used in the cases like searching celebrity-looking faces.
-     *
-     * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
-     * target faceId array.
+     * 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.
@@ -288,13 +254,8 @@ public List findSimilar(String faceId, List faceI
     /**
      * Verify whether two faces belong to a same person.
      *
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Higher face image quality means better identification precision. Please consider high-quality faces:
-     * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
-     * > * For the scenarios that are sensitive to accuracy please make your own judgment.
-     * > * The 'recognitionModel' associated with the both faces should be the same.
+     * 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".
@@ -320,16 +281,7 @@ public FaceVerificationResult verifyFaceToFace(String faceId1, String faceId2) {
     /**
      * Divide candidate faces into groups based on face similarity.
      *
-     * >
-     * *
-     * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have
-     * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice
-     * that faces belonging to a same person might be split into several groups in the result.
-     * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original
-     * faces. The messyGroup will not appear in the result if all faces found their counterparts.
-     * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you
-     * only have 2 candidate faces.
-     * * The 'recognitionModel' associated with the query faces' faceIds should be the same.
+     * 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.
@@ -358,45 +310,16 @@ public FaceGroupingResult group(List faceIds) {
     /**
      * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.
      *
-     * > [!IMPORTANT]
-     * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional
-     * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair
-     * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile,
-     * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible
-     * use case that would benefit from the use of any of the limited capabilities. Read more about this decision
-     * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/.
-     *
-     * *
-     * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an
-     * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face
-     * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call.
-     * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion,
-     * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific
-     * attributes may not be highly accurate.
-     * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
-     * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with
-     * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size.
-     * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small.
-     * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use
-     * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes).
-     * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer
-     * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model
-     * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model.
-     * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this
-     * detection model.
-     * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find
-     * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value
-     * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need
-     * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model.
-     * More details, please refer to
-     * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more
+     * details.
      * 

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -543,45 +466,15 @@ Response detectFromUrlImplWithResponse(BinaryData detectFromUrlReque /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. *

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -726,38 +619,8 @@ Response detectImplWithResponse(BinaryData imageContent, RequestOpti /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * 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. @@ -814,42 +677,13 @@ List detectFromUrlImpl(DetectFromUrlImplOptions options) { /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * 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 @@ -910,38 +744,7 @@ List detectImpl(BinaryData imageContent, FaceDetectionModel /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. * * @param imageContent The input image binary. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1438,4 +1241,317 @@ public List detect(String url, FaceDetectionModel detection FaceRecognitionModel recognitionModel, boolean returnFaceId, List returnFaceAttributes) { return this.detect(url, detectionModel, recognitionModel, returnFaceId, returnFaceAttributes, null, null, null); } + + /** + * 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. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromLargePersonGroupWithResponse(BinaryData identifyFromLargePersonGroupRequest, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromLargePersonGroupWithResponse(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 verify result along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromLargePersonGroupWithResponse(BinaryData verifyFromLargePersonGroupRequest, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromLargePersonGroupWithResponse(verifyFromLargePersonGroupRequest, + 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. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilarFromLargeFaceList(String faceId, String largeFaceListId, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest findSimilarFromLargeFaceListRequestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData findSimilarFromLargeFaceListRequest = BinaryData.fromObject(findSimilarFromLargeFaceListRequestObj); + return findSimilarFromLargeFaceListWithResponse(findSimilarFromLargeFaceListRequest, 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. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar-from-large-face-list 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 largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilarFromLargeFaceList(String faceId, String largeFaceListId) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest findSimilarFromLargeFaceListRequestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId); + BinaryData findSimilarFromLargeFaceListRequest = BinaryData.fromObject(findSimilarFromLargeFaceListRequestObj); + return findSimilarFromLargeFaceListWithResponse(findSimilarFromLargeFaceListRequest, 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. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group + * for more details. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromLargePersonGroup(List faceIds, String largePersonGroupId, + Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest identifyFromLargePersonGroupRequestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData identifyFromLargePersonGroupRequest = BinaryData.fromObject(identifyFromLargePersonGroupRequestObj); + return identifyFromLargePersonGroupWithResponse(identifyFromLargePersonGroupRequest, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group + * for more details. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromLargePersonGroup(List faceIds, + String largePersonGroupId) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest identifyFromLargePersonGroupRequestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId); + BinaryData identifyFromLargePersonGroupRequest = BinaryData.fromObject(identifyFromLargePersonGroupRequestObj); + return identifyFromLargePersonGroupWithResponse(identifyFromLargePersonGroupRequest, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 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. + * + * @param faceId The faceId of the face, come from "Detect". + * @param largePersonGroupId Using existing largePersonGroupId and personId for fast loading a specified person. + * largePersonGroupId is created in "Create Large Person Group". + * @param personId Specify a certain person in Large Person Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceVerificationResult verifyFromLargePersonGroup(String faceId, String largePersonGroupId, + String personId) { + // Generated convenience method for verifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromLargePersonGroupRequest verifyFromLargePersonGroupRequestObj + = new VerifyFromLargePersonGroupRequest(faceId, largePersonGroupId, personId); + BinaryData verifyFromLargePersonGroupRequest = BinaryData.fromObject(verifyFromLargePersonGroupRequestObj); + return verifyFromLargePersonGroupWithResponse(verifyFromLargePersonGroupRequest, requestOptions).getValue() + .toObject(FaceVerificationResult.class); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT + = new TypeReference>() { + }; } 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 42ad631a5180f..094c62c68a137 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 @@ -6,11 +6,17 @@ 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.CreateLivenessWithVerifySessionJsonContent; +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; @@ -29,6 +35,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.TypeReference; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** @@ -53,20 +61,8 @@ public final class FaceSessionAsyncClient { /** * Create a new detect liveness session. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLiveness/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To - * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your - * resource, use the List Liveness Session Audit Entries. + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for + * more details. *

Request Body Schema

* *
{@code
@@ -109,11 +105,8 @@ public Mono> createLivenessSessionWithResponse(BinaryData b
     /**
      * Delete all session related information for matching the specified session id.
      *
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -130,7 +123,8 @@ public Mono> deleteLivenessSessionWithResponse(String sessionId,
     }
 
     /**
-     * Get session result of detectLiveness/singleModal call.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result
+     * for more details.
      * 

Response Body Schema

* *
{@code
@@ -198,8 +192,7 @@ public Mono> deleteLivenessSessionWithResponse(String sessionId,
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLiveness/singleModal call along with {@link Response} on successful completion of
-     * {@link Mono}.
+     * @return session result of detect liveness along with {@link Response} on successful completion of {@link Mono}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -211,9 +204,8 @@ public Mono> getLivenessSessionResultWithResponse(String se
     /**
      * Lists sessions for /detectLiveness/SingleModal.
      *
-     * List sessions from the last sessionId greater than the 'start'.
-     *
-     * The result should be ordered by sessionId in ascending order.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for
+     * more details.
      * 

Query Parameters

* * @@ -253,7 +245,9 @@ public Mono> getLivenessSessionsWithResponse(RequestOptions } /** - * Gets session requests and response body for the session. + * 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
* @@ -324,8 +318,7 @@ public Mono> getLivenessSessionsWithResponse(RequestOptions * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return session requests and response body for the session along with {@link Response} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -338,28 +331,9 @@ public Mono> getLivenessSessionAuditEntriesWithResponse(Str * Create a new liveness session with verify. Client device submits VerifyImage during the * /detectLivenessWithVerify/singleModal call. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. - * - * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. - * > [!NOTE] - * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * 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
@@ -413,26 +387,9 @@ Mono> createLivenessWithVerifySessionWithResponse(BinaryDat
     /**
      * Create a new liveness session with verify. Provide the verify image during session creation.
      *
-     * A session is best for client device scenarios where developers want to authorize a client device to perform only
-     * a liveness detection without granting full access to their resource. Created sessions have a limited life span
-     * and only authorize clients to perform the desired action before access is expired.
-     *
-     * Permissions includes...
-     * >
-     * *
-     * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries.
-     * * A token lifetime of 10 minutes.
-     *
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session
-     * operation.
-     * > * To retrieve a result, use the Get Liveness With Verify Session.
-     * > * To audit the individual requests that a client has made to your resource, use the List Liveness With
-     * Verify Session Audit Entries.
-     *
-     * Recommended Option: VerifyImage is provided during session creation.
+     * 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
@@ -472,11 +429,9 @@ Mono> createLivenessWithVerifySessionWithVerifyImageWithRes
     /**
      * Delete all session related information for matching the specified session id.
      *
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -494,7 +449,9 @@ public Mono> deleteLivenessWithVerifySessionWithResponse(String s
     }
 
     /**
-     * Get session result of detectLivenessWithVerify/singleModal call.
+     * 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
@@ -562,8 +519,8 @@ public Mono> deleteLivenessWithVerifySessionWithResponse(String s
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response} on successful
-     * completion of {@link Mono}.
+     * @return session result of detect liveness with verify along with {@link Response} on successful completion of
+     * {@link Mono}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -575,9 +532,9 @@ public Mono> getLivenessWithVerifySessionResultWithResponse
     /**
      * Lists sessions for /detectLivenessWithVerify/SingleModal.
      *
-     * List sessions from the last sessionId greater than the "start".
-     *
-     * The result should be ordered by sessionId in ascending order.
+     * 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
* @@ -617,7 +574,9 @@ public Mono> getLivenessWithVerifySessionsWithResponse(Requ } /** - * Gets session requests and response body for the session. + * 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
* @@ -688,8 +647,7 @@ public Mono> getLivenessWithVerifySessionsWithResponse(Requ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return session requests and response body for the session along with {@link Response} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -701,20 +659,8 @@ public Mono> getLivenessWithVerifySessionAuditEntriesWithRe /** * Create a new detect liveness session. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLiveness/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To - * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your - * resource, use the List Liveness Session Audit Entries. + * 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. @@ -737,11 +683,8 @@ public Mono createLivenessSession(CreateLivenessSes /** * Delete all session related information for matching the specified session id. * - * > [!NOTE] - * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth - * Token. While this can be used to remove any access for that token, those requests will still count towards - * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is - * misused. + * 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. @@ -761,7 +704,8 @@ public Mono deleteLivenessSession(String sessionId) { } /** - * Get session result of detectLiveness/singleModal call. + * 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. @@ -770,7 +714,7 @@ public Mono deleteLivenessSession(String sessionId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session result of detectLiveness/singleModal call on successful completion of {@link Mono}. + * @return session result of detect liveness on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -784,9 +728,8 @@ public Mono getLivenessSessionResult(String sessionId) { /** * Lists sessions for /detectLiveness/SingleModal. * - * List sessions from the last sessionId greater than the 'start'. - * - * The result should be ordered by sessionId in ascending order. + * 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. @@ -816,9 +759,8 @@ public Mono> getLivenessSessions(String start, Integer /** * Lists sessions for /detectLiveness/SingleModal. * - * List sessions from the last sessionId greater than the 'start'. - * - * The result should be ordered by sessionId in ascending order. + * 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. @@ -837,7 +779,9 @@ public Mono> getLivenessSessions() { } /** - * Gets session requests and response body for the session. + * 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. @@ -848,7 +792,7 @@ public Mono> getLivenessSessions() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -867,7 +811,9 @@ public Mono> getLivenessSessionAuditEntries(Stri } /** - * Gets session requests and response body for the session. + * 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. @@ -876,7 +822,7 @@ public Mono> getLivenessSessionAuditEntries(Stri * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -890,11 +836,9 @@ public Mono> getLivenessSessionAuditEntries(Stri /** * Delete all session related information for matching the specified session id. * - * > [!NOTE] - * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth - * Token. While this can be used to remove any access for that token, those requests will still count towards - * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is - * misused. + * 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. @@ -914,7 +858,9 @@ public Mono deleteLivenessWithVerifySession(String sessionId) { } /** - * Get session result of detectLivenessWithVerify/singleModal call. + * 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. @@ -923,7 +869,7 @@ public Mono deleteLivenessWithVerifySession(String sessionId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session result of detectLivenessWithVerify/singleModal call on successful completion of {@link Mono}. + * @return session result of detect liveness with verify on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -937,9 +883,9 @@ public Mono getLivenessWithVerifySessionResult(String /** * Lists sessions for /detectLivenessWithVerify/SingleModal. * - * List sessions from the last sessionId greater than the "start". - * - * The result should be ordered by sessionId in ascending order. + * 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. @@ -969,9 +915,9 @@ public Mono> getLivenessWithVerifySessions(String star /** * Lists sessions for /detectLivenessWithVerify/SingleModal. * - * List sessions from the last sessionId greater than the "start". - * - * The result should be ordered by sessionId in ascending order. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-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. @@ -990,7 +936,9 @@ public Mono> getLivenessWithVerifySessions() { } /** - * Gets session requests and response body for the session. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-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. @@ -1001,7 +949,7 @@ public Mono> getLivenessWithVerifySessions() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1020,7 +968,9 @@ public Mono> getLivenessWithVerifySessionAuditEn } /** - * Gets session requests and response body for the session. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries + * for more details. * * @param sessionId The unique ID to reference this session. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1029,7 +979,7 @@ public Mono> getLivenessWithVerifySessionAuditEn * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1053,26 +1003,9 @@ public Mono> getLivenessWithVerifySessionAuditEn /** * Create a new liveness session with verify. Provide the verify image during session creation. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. - * - * Recommended Option: VerifyImage is provided during session creation. + * 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 body Request content of liveness with verify session creation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1101,31 +1034,280 @@ public Mono> getLivenessWithVerifySessionAuditEn } /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. + * 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-session-image-id + * for more details. + *

Query Parameters

+ *
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
+     * {
+     *     sessionImageId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param detectFromSessionImageRequest The detectFromSessionImageRequest 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> detectFromSessionImageWithResponse(BinaryData detectFromSessionImageRequest, + RequestOptions requestOptions) { + return this.serviceClient.detectFromSessionImageWithResponseAsync(detectFromSessionImageRequest, + requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
* - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. + * @param sessionImageId The request ID of the image to be retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> getSessionImageWithResponse(String sessionImageId, + RequestOptions requestOptions) { + return this.serviceClient.getSessionImageWithResponseAsync(sessionImageId, requestOptions); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-session-image-id + * for more details. * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. + * @param options Options for detectFromSessionImage 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 body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectFromSessionImage(DetectFromSessionImageOptions options) { + // Generated convenience method for detectFromSessionImageWithResponse + 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(); + DetectFromSessionImageRequest detectFromSessionImageRequestObj + = new DetectFromSessionImageRequest(options.getSessionImageId()); + BinaryData detectFromSessionImageRequest = BinaryData.fromObject(detectFromSessionImageRequestObj); + 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 detectFromSessionImageWithResponse(detectFromSessionImageRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more + * details. + * + * @param sessionImageId The request ID of the image to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the 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 getSessionImage(String sessionImageId) { + // Generated convenience method for getSessionImageWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSessionImageWithResponse(sessionImageId, requestOptions).flatMap(FluxUtil::toMono); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT + = new TypeReference>() { + }; + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. * - * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. - * > [!NOTE] - * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * more details. * * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1140,7 +1322,7 @@ public Mono> getLivenessWithVerifySessionAuditEn @Generated @ServiceMethod(returns = ReturnType.SINGLE) Mono - createLivenessWithVerifySession(CreateLivenessWithVerifySessionJsonContent body) { + createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent body) { // Generated convenience method for createLivenessWithVerifySessionWithResponse RequestOptions requestOptions = new RequestOptions(); return createLivenessWithVerifySessionWithResponse(BinaryData.fromObject(body), requestOptions) @@ -1152,27 +1334,12 @@ public Mono> getLivenessWithVerifySessionAuditEn * Create a new liveness session with verify. Client device submits VerifyImage during the * /detectLivenessWithVerify/singleModal call. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * more details. * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. - * - * @param createLivenessWithVerifySessionParameters Request for creating liveness session. - * @param verifyImage the content value of the verify image. + * @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. @@ -1182,15 +1349,15 @@ public Mono> getLivenessWithVerifySessionAuditEn * @return response of liveness session with verify creation with verify image provided on successful completion of * {@link Mono}. */ - public Mono createLivenessWithVerifySession( - CreateLivenessWithVerifySessionJsonContent createLivenessWithVerifySessionParameters, BinaryData verifyImage) { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent parameters, BinaryData verifyImage) { if (verifyImage == null) { - return createLivenessWithVerifySession(createLivenessWithVerifySessionParameters); + return createLivenessWithVerifySession(parameters); } VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage); CreateLivenessWithVerifySessionMultipartContent realParameters - = new CreateLivenessWithVerifySessionMultipartContent(createLivenessWithVerifySessionParameters, - verifyImageFileDetails); + = new CreateLivenessWithVerifySessionMultipartContent(parameters, verifyImageFileDetails); return this.createLivenessWithVerifySessionWithVerifyImage(realParameters); } } 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 87aef94402d2c..ba925d5675699 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 @@ -6,11 +6,17 @@ 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.CreateLivenessWithVerifySessionJsonContent; +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; @@ -28,6 +34,8 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.serializer.TypeReference; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * Initializes a new instance of the synchronous FaceSessionClient type. @@ -51,20 +59,8 @@ public final class FaceSessionClient { /** * Create a new detect liveness session. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLiveness/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To - * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your - * resource, use the List Liveness Session Audit Entries. + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for + * more details. *

Request Body Schema

* *
{@code
@@ -105,11 +101,8 @@ public Response createLivenessSessionWithResponse(BinaryData body, R
     /**
      * Delete all session related information for matching the specified session id.
      *
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -126,7 +119,8 @@ public Response deleteLivenessSessionWithResponse(String sessionId, Reques
     }
 
     /**
-     * Get session result of detectLiveness/singleModal call.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result
+     * for more details.
      * 

Response Body Schema

* *
{@code
@@ -194,7 +188,7 @@ public Response deleteLivenessSessionWithResponse(String sessionId, Reques
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLiveness/singleModal call along with {@link Response}.
+     * @return session result of detect liveness along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -205,9 +199,8 @@ public Response getLivenessSessionResultWithResponse(String sessionI
     /**
      * Lists sessions for /detectLiveness/SingleModal.
      *
-     * List sessions from the last sessionId greater than the 'start'.
-     *
-     * The result should be ordered by sessionId in ascending order.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for
+     * more details.
      * 

Query Parameters

* * @@ -247,7 +240,9 @@ public Response getLivenessSessionsWithResponse(RequestOptions reque } /** - * Gets session requests and response body for the session. + * 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
* @@ -318,7 +313,7 @@ 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 session requests and response body for the session along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -331,28 +326,9 @@ public Response getLivenessSessionAuditEntriesWithResponse(String se * Create a new liveness session with verify. Client device submits VerifyImage during the * /detectLivenessWithVerify/singleModal call. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. - * - * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. - * > [!NOTE] - * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * 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
@@ -404,26 +380,9 @@ Response createLivenessWithVerifySessionWithResponse(BinaryData body
     /**
      * Create a new liveness session with verify. Provide the verify image during session creation.
      *
-     * A session is best for client device scenarios where developers want to authorize a client device to perform only
-     * a liveness detection without granting full access to their resource. Created sessions have a limited life span
-     * and only authorize clients to perform the desired action before access is expired.
-     *
-     * Permissions includes...
-     * >
-     * *
-     * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries.
-     * * A token lifetime of 10 minutes.
-     *
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session
-     * operation.
-     * > * To retrieve a result, use the Get Liveness With Verify Session.
-     * > * To audit the individual requests that a client has made to your resource, use the List Liveness With
-     * Verify Session Audit Entries.
-     *
-     * Recommended Option: VerifyImage is provided during session creation.
+     * 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
@@ -462,11 +421,9 @@ Response createLivenessWithVerifySessionWithVerifyImageWithResponse(
     /**
      * Delete all session related information for matching the specified session id.
      *
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -483,7 +440,9 @@ public Response deleteLivenessWithVerifySessionWithResponse(String session
     }
 
     /**
-     * Get session result of detectLivenessWithVerify/singleModal call.
+     * 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
@@ -551,7 +510,7 @@ public Response deleteLivenessWithVerifySessionWithResponse(String session
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response}.
+     * @return session result of detect liveness with verify along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -563,9 +522,9 @@ public Response getLivenessWithVerifySessionResultWithResponse(Strin
     /**
      * Lists sessions for /detectLivenessWithVerify/SingleModal.
      *
-     * List sessions from the last sessionId greater than the "start".
-     *
-     * The result should be ordered by sessionId in ascending order.
+     * 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
* @@ -605,7 +564,9 @@ public Response getLivenessWithVerifySessionsWithResponse(RequestOpt } /** - * Gets session requests and response body for the session. + * 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
* @@ -676,7 +637,7 @@ public Response getLivenessWithVerifySessionsWithResponse(RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return session requests and response body for the session along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -688,20 +649,8 @@ public Response getLivenessWithVerifySessionAuditEntriesWithResponse /** * Create a new detect liveness session. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLiveness/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To - * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your - * resource, use the List Liveness Session Audit Entries. + * 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. @@ -724,11 +673,8 @@ public CreateLivenessSessionResult createLivenessSession(CreateLivenessSessionCo /** * Delete all session related information for matching the specified session id. * - * > [!NOTE] - * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth - * Token. While this can be used to remove any access for that token, those requests will still count towards - * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is - * misused. + * 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. @@ -747,7 +693,8 @@ public void deleteLivenessSession(String sessionId) { } /** - * Get session result of detectLiveness/singleModal call. + * 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. @@ -756,7 +703,7 @@ public void deleteLivenessSession(String sessionId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session result of detectLiveness/singleModal call. + * @return session result of detect liveness. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -770,9 +717,8 @@ public LivenessSession getLivenessSessionResult(String sessionId) { /** * Lists sessions for /detectLiveness/SingleModal. * - * List sessions from the last sessionId greater than the 'start'. - * - * The result should be ordered by sessionId in ascending order. + * 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. @@ -802,9 +748,8 @@ public List getLivenessSessions(String start, Integer top) /** * Lists sessions for /detectLiveness/SingleModal. * - * List sessions from the last sessionId greater than the 'start'. - * - * The result should be ordered by sessionId in ascending order. + * 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. @@ -823,7 +768,9 @@ public List getLivenessSessions() { } /** - * Gets session requests and response body for the session. + * 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. @@ -834,7 +781,7 @@ public List getLivenessSessions() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -852,7 +799,9 @@ public List getLivenessSessionAuditEntries(String ses } /** - * Gets session requests and response body for the session. + * 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. @@ -861,7 +810,7 @@ public List getLivenessSessionAuditEntries(String ses * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -875,11 +824,9 @@ public List getLivenessSessionAuditEntries(String ses /** * Delete all session related information for matching the specified session id. * - * > [!NOTE] - * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth - * Token. While this can be used to remove any access for that token, those requests will still count towards - * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is - * misused. + * 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. @@ -898,7 +845,9 @@ public void deleteLivenessWithVerifySession(String sessionId) { } /** - * Get session result of detectLivenessWithVerify/singleModal call. + * 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. @@ -907,7 +856,7 @@ public void deleteLivenessWithVerifySession(String sessionId) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session result of detectLivenessWithVerify/singleModal call. + * @return session result of detect liveness with verify. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -921,9 +870,9 @@ public LivenessWithVerifySession getLivenessWithVerifySessionResult(String sessi /** * Lists sessions for /detectLivenessWithVerify/SingleModal. * - * List sessions from the last sessionId greater than the "start". - * - * The result should be ordered by sessionId in ascending order. + * 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. @@ -953,9 +902,9 @@ public List getLivenessWithVerifySessions(String start, Int /** * Lists sessions for /detectLivenessWithVerify/SingleModal. * - * List sessions from the last sessionId greater than the "start". - * - * The result should be ordered by sessionId in ascending order. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-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. @@ -974,7 +923,9 @@ public List getLivenessWithVerifySessions() { } /** - * Gets session requests and response body for the session. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-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. @@ -985,7 +936,7 @@ public List getLivenessWithVerifySessions() { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1004,7 +955,9 @@ public List getLivenessWithVerifySessionAuditEntries( } /** - * Gets session requests and response body for the session. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries + * for more details. * * @param sessionId The unique ID to reference this session. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1013,7 +966,7 @@ public List getLivenessWithVerifySessionAuditEntries( * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return session requests and response body for the session. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1037,26 +990,9 @@ public List getLivenessWithVerifySessionAuditEntries( /** * Create a new liveness session with verify. Provide the verify image during session creation. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. - * - * Recommended Option: VerifyImage is provided during session creation. + * 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 body Request content of liveness with verify session creation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1083,31 +1019,277 @@ public List getLivenessWithVerifySessionAuditEntries( } /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. + * 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-session-image-id + * for more details. + *

Query Parameters

+ *
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
+     * {
+     *     sessionImageId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param detectFromSessionImageRequest The detectFromSessionImageRequest 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 detectFromSessionImageWithResponse(BinaryData detectFromSessionImageRequest, + RequestOptions requestOptions) { + return this.serviceClient.detectFromSessionImageWithResponse(detectFromSessionImageRequest, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
* - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. + * @param sessionImageId The request ID of the image to be retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 getSessionImageWithResponse(String sessionImageId, RequestOptions requestOptions) { + return this.serviceClient.getSessionImageWithResponse(sessionImageId, requestOptions); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-session-image-id + * for more details. * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. + * @param options Options for detectFromSessionImage 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) + public List detectFromSessionImage(DetectFromSessionImageOptions options) { + // Generated convenience method for detectFromSessionImageWithResponse + 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(); + DetectFromSessionImageRequest detectFromSessionImageRequestObj + = new DetectFromSessionImageRequest(options.getSessionImageId()); + BinaryData detectFromSessionImageRequest = BinaryData.fromObject(detectFromSessionImageRequestObj); + 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 detectFromSessionImageWithResponse(detectFromSessionImageRequest, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more + * details. + * + * @param sessionImageId The request ID of the image to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the 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 BinaryData getSessionImage(String sessionImageId) { + // Generated convenience method for getSessionImageWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSessionImageWithResponse(sessionImageId, requestOptions).getValue(); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT + = new TypeReference>() { + }; + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. * - * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. - * > [!NOTE] - * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * more details. * * @param body Body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1120,8 +1302,7 @@ public List getLivenessWithVerifySessionAuditEntries( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - CreateLivenessWithVerifySessionResult - createLivenessWithVerifySession(CreateLivenessWithVerifySessionJsonContent body) { + CreateLivenessWithVerifySessionResult createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent body) { // Generated convenience method for createLivenessWithVerifySessionWithResponse RequestOptions requestOptions = new RequestOptions(); return createLivenessWithVerifySessionWithResponse(BinaryData.fromObject(body), requestOptions).getValue() @@ -1129,29 +1310,15 @@ public List getLivenessWithVerifySessionAuditEntries( } /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * more details. * - * @param createLivenessWithVerifySessionParameters Request for creating liveness session. - * @param verifyImage The image to be verified. + * @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. @@ -1160,15 +1327,15 @@ public List getLivenessWithVerifySessionAuditEntries( * @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. */ - public CreateLivenessWithVerifySessionResult createLivenessWithVerifySession( - CreateLivenessWithVerifySessionJsonContent createLivenessWithVerifySessionParameters, BinaryData verifyImage) { + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateLivenessWithVerifySessionResult + createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent parameters, BinaryData verifyImage) { if (verifyImage == null) { - return createLivenessWithVerifySession(createLivenessWithVerifySessionParameters); + return createLivenessWithVerifySession(parameters); } VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage); CreateLivenessWithVerifySessionMultipartContent realParameters - = new CreateLivenessWithVerifySessionMultipartContent(createLivenessWithVerifySessionParameters, - verifyImageFileDetails); + = new CreateLivenessWithVerifySessionMultipartContent(parameters, verifyImageFileDetails); return this.createLivenessWithVerifySessionWithVerifyImage(realParameters); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargeFaceListAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargeFaceListAsyncClient.java new file mode 100644 index 0000000000000..b847fc4e6e30b --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargeFaceListAsyncClient.java @@ -0,0 +1,1068 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.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.models.AddFaceResult; +import com.azure.ai.vision.face.models.FaceDetectionModel; +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.ai.vision.face.models.FaceTrainingResult; +import com.azure.ai.vision.face.models.LargeFaceList; +import com.azure.ai.vision.face.models.LargeFaceListFace; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous FaceAdministrationClient type. + */ +@ServiceClient(builder = FaceAdministrationClientBuilder.class, isAsync = true) +public final class LargeFaceListAsyncClient { + + @Generated + private final LargeFaceListsImpl serviceClient; + + /** + * Initializes an instance of LargeFaceListAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + LargeFaceListAsyncClient(LargeFaceListsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> createWithResponse(String largeFaceListId, BinaryData createRequest1, + RequestOptions requestOptions) { + return this.serviceClient.createWithResponseAsync(largeFaceListId, createRequest1, requestOptions); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + *

Query Parameters

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return large face list is a list of faces, up to 1,000,000 faces along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> updateWithResponse(String largeFaceListId, BinaryData updateRequest1, + RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(largeFaceListId, updateRequest1, requestOptions); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListsWithResponseAsync(requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-training-status for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainingStatusWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.getTrainingStatusWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrain(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.beginTrainAsync(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> addFaceFromUrlImplWithResponse(String largeFaceListId, BinaryData addFaceFromUrlRequest1, + RequestOptions requestOptions) { + return this.serviceClient.addFaceFromUrlImplWithResponseAsync(largeFaceListId, addFaceFromUrlRequest1, + requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> addFaceImplWithResponse(String largeFaceListId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addFaceImplWithResponseAsync(largeFaceListId, imageContent, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteFaceWithResponseAsync(largeFaceListId, persistedFaceId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.getFaceWithResponseAsync(largeFaceListId, persistedFaceId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> updateFaceWithResponse(String largeFaceListId, String persistedFaceId, + BinaryData updateFaceRequest1, RequestOptions requestOptions) { + return this.serviceClient.updateFaceWithResponseAsync(largeFaceListId, persistedFaceId, updateFaceRequest1, + requestOptions); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces 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){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFacesWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.getFacesWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono create(String largeFaceListId, 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(largeFaceListId, createRequest1, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono create(String largeFaceListId, String name) { + // Generated convenience method for createWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateRequest1 createRequest1Obj = new CreateRequest1(name); + BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); + return createWithResponse(largeFaceListId, createRequest1, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono delete(String largeFaceListId) { + // Generated convenience method for deleteWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get(String largeFaceListId, Boolean returnRecognitionModel) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargeFaceList.class)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get(String largeFaceListId) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargeFaceList.class)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono update(String largeFaceListId, 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(largeFaceListId, updateRequest1, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono update(String largeFaceListId) { + // Generated convenience method for updateWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateRequest1 updateRequest1Obj = new UpdateRequest1(); + BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); + return updateWithResponse(largeFaceListId, updateRequest1, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceLists(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargeFaceListsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST)); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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> getLargeFaceLists() { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-training-status for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTrainingStatus(String largeFaceListId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceTrainingResult.class)); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrain(String largeFaceListId) { + // Generated convenience method for beginTrainWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainWithModelAsync(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceFromUrlImpl(String largeFaceListId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceFromUrlImplWithResponse(largeFaceListId, addFaceFromUrlRequest1, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceFromUrlImpl(String largeFaceListId, String url) { + // Generated convenience method for addFaceFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + return addFaceFromUrlImplWithResponse(largeFaceListId, addFaceFromUrlRequest1, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceImpl(String largeFaceListId, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceImplWithResponse(largeFaceListId, imageContent, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceImpl(String largeFaceListId, BinaryData imageContent) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addFaceImplWithResponse(largeFaceListId, imageContent, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for deleteFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large face list on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for getFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargeFaceListFace.class)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateFace(String largeFaceListId, 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(largeFaceListId, persistedFaceId, updateFaceRequest1, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for updateFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1(); + BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); + return updateFaceWithResponse(largeFaceListId, persistedFaceId, updateFaceRequest1, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaces(String largeFaceListId, String start, Integer top) { + // Generated convenience method for getFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getFacesWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE)); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaces(String largeFaceListId) { + // Generated convenience method for getFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFacesWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE)); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST + = new TypeReference>() { + }; +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargeFaceListClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargeFaceListClient.java new file mode 100644 index 0000000000000..2ef761ba3de99 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargeFaceListClient.java @@ -0,0 +1,1047 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.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.models.AddFaceResult; +import com.azure.ai.vision.face.models.FaceDetectionModel; +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.ai.vision.face.models.FaceTrainingResult; +import com.azure.ai.vision.face.models.LargeFaceList; +import com.azure.ai.vision.face.models.LargeFaceListFace; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; + +/** + * Initializes a new instance of the synchronous FaceAdministrationClient type. + */ +@ServiceClient(builder = FaceAdministrationClientBuilder.class) +public final class LargeFaceListClient { + + @Generated + private final LargeFaceListsImpl serviceClient; + + /** + * Initializes an instance of LargeFaceListClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + LargeFaceListClient(LargeFaceListsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 createWithResponse(String largeFaceListId, BinaryData createRequest1, + RequestOptions requestOptions) { + return this.serviceClient.createWithResponse(largeFaceListId, createRequest1, requestOptions); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponse(largeFaceListId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + *

Query Parameters

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

Response Body Schema

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

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 updateWithResponse(String largeFaceListId, BinaryData updateRequest1, + RequestOptions requestOptions) { + return this.serviceClient.updateWithResponse(largeFaceListId, updateRequest1, requestOptions); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListsWithResponse(requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-training-status for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainingStatusWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.getTrainingStatusWithResponse(largeFaceListId, requestOptions); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.beginTrain(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response addFaceFromUrlImplWithResponse(String largeFaceListId, BinaryData addFaceFromUrlRequest1, + RequestOptions requestOptions) { + return this.serviceClient.addFaceFromUrlImplWithResponse(largeFaceListId, addFaceFromUrlRequest1, + requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response addFaceImplWithResponse(String largeFaceListId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addFaceImplWithResponse(largeFaceListId, imageContent, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.getFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 updateFaceWithResponse(String largeFaceListId, String persistedFaceId, + BinaryData updateFaceRequest1, RequestOptions requestOptions) { + return this.serviceClient.updateFaceWithResponse(largeFaceListId, persistedFaceId, updateFaceRequest1, + requestOptions); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces 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){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFacesWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.getFacesWithResponse(largeFaceListId, requestOptions); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void create(String largeFaceListId, 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(largeFaceListId, createRequest1, requestOptions).getValue(); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void create(String largeFaceListId, String name) { + // Generated convenience method for createWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateRequest1 createRequest1Obj = new CreateRequest1(name); + BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); + createWithResponse(largeFaceListId, createRequest1, requestOptions).getValue(); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String largeFaceListId) { + // Generated convenience method for deleteWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteWithResponse(largeFaceListId, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargeFaceList get(String largeFaceListId, Boolean returnRecognitionModel) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getWithResponse(largeFaceListId, requestOptions).getValue().toObject(LargeFaceList.class); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargeFaceList get(String largeFaceListId) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(largeFaceListId, requestOptions).getValue().toObject(LargeFaceList.class); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String largeFaceListId, 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(largeFaceListId, updateRequest1, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String largeFaceListId) { + // Generated convenience method for updateWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateRequest1 updateRequest1Obj = new UpdateRequest1(); + BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); + updateWithResponse(largeFaceListId, updateRequest1, requestOptions).getValue(); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargeFaceLists(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargeFaceListsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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 getLargeFaceLists() { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-training-status for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceTrainingResult getTrainingStatus(String largeFaceListId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(largeFaceListId, requestOptions).getValue() + .toObject(FaceTrainingResult.class); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String largeFaceListId) { + // Generated convenience method for beginTrainWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainWithModel(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceFromUrlImpl(String largeFaceListId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceFromUrlImplWithResponse(largeFaceListId, addFaceFromUrlRequest1, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceFromUrlImpl(String largeFaceListId, String url) { + // Generated convenience method for addFaceFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + return addFaceFromUrlImplWithResponse(largeFaceListId, addFaceFromUrlRequest1, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceImpl(String largeFaceListId, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceImplWithResponse(largeFaceListId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceImpl(String largeFaceListId, BinaryData imageContent) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addFaceImplWithResponse(largeFaceListId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for deleteFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large face list. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargeFaceListFace getFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for getFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions).getValue() + .toObject(LargeFaceListFace.class); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateFace(String largeFaceListId, 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(largeFaceListId, persistedFaceId, updateFaceRequest1, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for updateFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1(); + BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); + updateFaceWithResponse(largeFaceListId, persistedFaceId, updateFaceRequest1, requestOptions).getValue(); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getFaces(String largeFaceListId, String start, Integer top) { + // Generated convenience method for getFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getFacesWithResponse(largeFaceListId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getFaces(String largeFaceListId) { + // Generated convenience method for getFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFacesWithResponse(largeFaceListId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST + = new TypeReference>() { + }; +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargePersonGroupAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargePersonGroupAsyncClient.java new file mode 100644 index 0000000000000..3e7b21db1285a --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargePersonGroupAsyncClient.java @@ -0,0 +1,1414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.LargePersonGroupsImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest; +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.UpdatePersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdateRequest; +import com.azure.ai.vision.face.models.AddFaceResult; +import com.azure.ai.vision.face.models.CreatePersonResult; +import com.azure.ai.vision.face.models.FaceDetectionModel; +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.ai.vision.face.models.FaceTrainingResult; +import com.azure.ai.vision.face.models.LargePersonGroup; +import com.azure.ai.vision.face.models.LargePersonGroupPerson; +import com.azure.ai.vision.face.models.LargePersonGroupPersonFace; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous FaceAdministrationClient type. + */ +@ServiceClient(builder = FaceAdministrationClientBuilder.class, isAsync = true) +public final class LargePersonGroupAsyncClient { + + @Generated + private final LargePersonGroupsImpl serviceClient; + + /** + * Initializes an instance of LargePersonGroupAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + LargePersonGroupAsyncClient(LargePersonGroupsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> createWithResponse(String largePersonGroupId, BinaryData createRequest, + RequestOptions requestOptions) { + return this.serviceClient.createWithResponseAsync(largePersonGroupId, createRequest, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + *

Query Parameters

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @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. + * @throws ResourceNotFoundException thrown if the request 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> updateWithResponse(String largePersonGroupId, BinaryData updateRequest, + RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(largePersonGroupId, updateRequest, requestOptions); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupsWithResponseAsync(requestOptions); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-training-status for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainingStatusWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getTrainingStatusWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrain(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.beginTrainAsync(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + *

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param createPersonRequest The createPersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createPersonWithResponse(String largePersonGroupId, + BinaryData createPersonRequest, RequestOptions requestOptions) { + return this.serviceClient.createPersonWithResponseAsync(largePersonGroupId, createPersonRequest, + requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.deletePersonWithResponseAsync(largePersonGroupId, personId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person + * for more details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified large person group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.getPersonWithResponseAsync(largePersonGroupId, personId, requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param updatePersonRequest The updatePersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonWithResponse(String largePersonGroupId, String personId, + BinaryData updatePersonRequest, RequestOptions requestOptions) { + return this.serviceClient.updatePersonWithResponseAsync(largePersonGroupId, personId, updatePersonRequest, + requestOptions); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * 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){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonsWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.getPersonsWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> addFaceFromUrlImplWithResponse(String largePersonGroupId, String personId, + BinaryData addFaceFromUrlRequest, RequestOptions requestOptions) { + return this.serviceClient.addFaceFromUrlImplWithResponseAsync(largePersonGroupId, personId, + addFaceFromUrlRequest, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> addFaceImplWithResponse(String largePersonGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.addFaceImplWithResponseAsync(largePersonGroupId, personId, imageContent, + requestOptions); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.deleteFaceWithResponseAsync(largePersonGroupId, personId, persistedFaceId, + requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person-face for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getFaceWithResponseAsync(largePersonGroupId, personId, persistedFaceId, + requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> updateFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, BinaryData updateFaceRequest, RequestOptions requestOptions) { + return this.serviceClient.updateFaceWithResponseAsync(largePersonGroupId, personId, persistedFaceId, + updateFaceRequest, requestOptions); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono create(String largePersonGroupId, 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(largePersonGroupId, createRequest, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono create(String largePersonGroupId, String name) { + // Generated convenience method for createWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateRequest createRequestObj = new CreateRequest(name); + BinaryData createRequest = BinaryData.fromObject(createRequestObj); + return createWithResponse(largePersonGroupId, createRequest, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono delete(String largePersonGroupId) { + // Generated convenience method for deleteWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get(String largePersonGroupId, Boolean returnRecognitionModel) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroup.class)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get(String largePersonGroupId) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroup.class)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono update(String largePersonGroupId, 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(largePersonGroupId, updateRequest, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono update(String largePersonGroupId) { + // Generated convenience method for updateWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateRequest updateRequestObj = new UpdateRequest(); + BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); + return updateWithResponse(largePersonGroupId, updateRequest, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroups(String start, Integer top, + Boolean returnRecognitionModel) { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargePersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP)); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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> getLargePersonGroups() { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP)); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-training-status for more + * details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTrainingStatus(String largePersonGroupId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceTrainingResult.class)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrain(String largePersonGroupId) { + // Generated convenience method for beginTrainWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainWithModelAsync(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPerson(String largePersonGroupId, String name, String userData) { + // Generated convenience method for createPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest createPersonRequestObj = new CreatePersonRequest(name).setUserData(userData); + BinaryData createPersonRequest = BinaryData.fromObject(createPersonRequestObj); + return createPersonWithResponse(largePersonGroupId, createPersonRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreatePersonResult.class)); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPerson(String largePersonGroupId, String name) { + // Generated convenience method for createPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest createPersonRequestObj = new CreatePersonRequest(name); + BinaryData createPersonRequest = BinaryData.fromObject(createPersonRequestObj); + return createPersonWithResponse(largePersonGroupId, createPersonRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreatePersonResult.class)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deletePerson(String largePersonGroupId, String personId) { + // Generated convenience method for deletePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deletePersonWithResponse(largePersonGroupId, personId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person + * for more details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the person in a specified large person group on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPerson(String largePersonGroupId, String personId) { + // Generated convenience method for getPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonWithResponse(largePersonGroupId, personId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroupPerson.class)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePerson(String largePersonGroupId, String personId, String name, String userData) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest updatePersonRequestObj = new UpdatePersonRequest().setName(name).setUserData(userData); + BinaryData updatePersonRequest = BinaryData.fromObject(updatePersonRequestObj); + return updatePersonWithResponse(largePersonGroupId, personId, updatePersonRequest, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePerson(String largePersonGroupId, String personId) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest updatePersonRequestObj = new UpdatePersonRequest(); + BinaryData updatePersonRequest = BinaryData.fromObject(updatePersonRequestObj); + return updatePersonWithResponse(largePersonGroupId, personId, updatePersonRequest, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * for more details. + * + * @param largePersonGroupId ID of the container. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersons(String largePersonGroupId, String start, Integer top) { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getPersonsWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON)); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * for more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersons(String largePersonGroupId) { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonsWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceFromUrlImpl(String largePersonGroupId, String personId, String url, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceFromUrlRequest addFaceFromUrlRequestObj = new AddFaceFromUrlRequest(url); + BinaryData addFaceFromUrlRequest = BinaryData.fromObject(addFaceFromUrlRequestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceFromUrlImplWithResponse(largePersonGroupId, personId, addFaceFromUrlRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceFromUrlImpl(String largePersonGroupId, 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(largePersonGroupId, personId, addFaceFromUrlRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceImpl(String largePersonGroupId, String personId, BinaryData imageContent, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceImplWithResponse(largePersonGroupId, personId, imageContent, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono addFaceImpl(String largePersonGroupId, String personId, BinaryData imageContent) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addFaceImplWithResponse(largePersonGroupId, personId, imageContent, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for deleteFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large person group person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getFace(String largePersonGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for getFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroupPersonFace.class)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateFace(String largePersonGroupId, 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(largePersonGroupId, personId, persistedFaceId, updateFaceRequest, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for updateFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest(); + BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); + return updateFaceWithResponse(largePersonGroupId, personId, persistedFaceId, updateFaceRequest, requestOptions) + .flatMap(FluxUtil::toMono); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON + = new TypeReference>() { + }; +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargePersonGroupClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargePersonGroupClient.java new file mode 100644 index 0000000000000..675def62bc886 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/LargePersonGroupClient.java @@ -0,0 +1,1382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.LargePersonGroupsImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest; +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.UpdatePersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdateRequest; +import com.azure.ai.vision.face.models.AddFaceResult; +import com.azure.ai.vision.face.models.CreatePersonResult; +import com.azure.ai.vision.face.models.FaceDetectionModel; +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.ai.vision.face.models.FaceTrainingResult; +import com.azure.ai.vision.face.models.LargePersonGroup; +import com.azure.ai.vision.face.models.LargePersonGroupPerson; +import com.azure.ai.vision.face.models.LargePersonGroupPersonFace; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; + +/** + * Initializes a new instance of the synchronous FaceAdministrationClient type. + */ +@ServiceClient(builder = FaceAdministrationClientBuilder.class) +public final class LargePersonGroupClient { + + @Generated + private final LargePersonGroupsImpl serviceClient; + + /** + * Initializes an instance of LargePersonGroupClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + LargePersonGroupClient(LargePersonGroupsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 createWithResponse(String largePersonGroupId, BinaryData createRequest, + RequestOptions requestOptions) { + return this.serviceClient.createWithResponse(largePersonGroupId, createRequest, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + *

Query Parameters

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @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. + * @throws ResourceNotFoundException thrown if the request 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 updateWithResponse(String largePersonGroupId, BinaryData updateRequest, + RequestOptions requestOptions) { + return this.serviceClient.updateWithResponse(largePersonGroupId, updateRequest, requestOptions); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupsWithResponse(requestOptions); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-training-status for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainingStatusWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getTrainingStatusWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.beginTrain(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + *

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param createPersonRequest The createPersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createPersonWithResponse(String largePersonGroupId, BinaryData createPersonRequest, + RequestOptions requestOptions) { + return this.serviceClient.createPersonWithResponse(largePersonGroupId, createPersonRequest, requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.deletePersonWithResponse(largePersonGroupId, personId, requestOptions); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person + * for more details. + *

Response Body Schema

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

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param updatePersonRequest The updatePersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonWithResponse(String largePersonGroupId, String personId, + BinaryData updatePersonRequest, RequestOptions requestOptions) { + return this.serviceClient.updatePersonWithResponse(largePersonGroupId, personId, updatePersonRequest, + requestOptions); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * 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){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonsWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.getPersonsWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response addFaceFromUrlImplWithResponse(String largePersonGroupId, String personId, + BinaryData addFaceFromUrlRequest, RequestOptions requestOptions) { + return this.serviceClient.addFaceFromUrlImplWithResponse(largePersonGroupId, personId, addFaceFromUrlRequest, + requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response addFaceImplWithResponse(String largePersonGroupId, String personId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addFaceImplWithResponse(largePersonGroupId, personId, imageContent, requestOptions); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceWithResponse(String largePersonGroupId, String personId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person-face for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceWithResponse(String largePersonGroupId, String personId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.getFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 updateFaceWithResponse(String largePersonGroupId, String personId, String persistedFaceId, + BinaryData updateFaceRequest, RequestOptions requestOptions) { + return this.serviceClient.updateFaceWithResponse(largePersonGroupId, personId, persistedFaceId, + updateFaceRequest, requestOptions); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void create(String largePersonGroupId, 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(largePersonGroupId, createRequest, requestOptions).getValue(); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void create(String largePersonGroupId, String name) { + // Generated convenience method for createWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateRequest createRequestObj = new CreateRequest(name); + BinaryData createRequest = BinaryData.fromObject(createRequestObj); + createWithResponse(largePersonGroupId, createRequest, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String largePersonGroupId) { + // Generated convenience method for deleteWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteWithResponse(largePersonGroupId, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 + * people. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroup get(String largePersonGroupId, Boolean returnRecognitionModel) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getWithResponse(largePersonGroupId, requestOptions).getValue().toObject(LargePersonGroup.class); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 + * people. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroup get(String largePersonGroupId) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(largePersonGroupId, requestOptions).getValue().toObject(LargePersonGroup.class); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String largePersonGroupId, 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(largePersonGroupId, updateRequest, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String largePersonGroupId) { + // Generated convenience method for updateWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateRequest updateRequestObj = new UpdateRequest(); + BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); + updateWithResponse(largePersonGroupId, updateRequest, requestOptions).getValue(); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargePersonGroups(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargePersonGroupsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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 getLargePersonGroups() { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-training-status for more + * details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceTrainingResult getTrainingStatus(String largePersonGroupId) { + // Generated convenience method for getTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTrainingStatusWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(FaceTrainingResult.class); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String largePersonGroupId) { + // Generated convenience method for beginTrainWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainWithModel(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreatePersonResult createPerson(String largePersonGroupId, String name, String userData) { + // Generated convenience method for createPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest createPersonRequestObj = new CreatePersonRequest(name).setUserData(userData); + BinaryData createPersonRequest = BinaryData.fromObject(createPersonRequestObj); + return createPersonWithResponse(largePersonGroupId, createPersonRequest, requestOptions).getValue() + .toObject(CreatePersonResult.class); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreatePersonResult createPerson(String largePersonGroupId, String name) { + // Generated convenience method for createPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest createPersonRequestObj = new CreatePersonRequest(name); + BinaryData createPersonRequest = BinaryData.fromObject(createPersonRequestObj); + return createPersonWithResponse(largePersonGroupId, createPersonRequest, requestOptions).getValue() + .toObject(CreatePersonResult.class); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePerson(String largePersonGroupId, String personId) { + // Generated convenience method for deletePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + deletePersonWithResponse(largePersonGroupId, personId, requestOptions).getValue(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person + * for more details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the person in a specified large person group. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroupPerson getPerson(String largePersonGroupId, String personId) { + // Generated convenience method for getPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonWithResponse(largePersonGroupId, personId, requestOptions).getValue() + .toObject(LargePersonGroupPerson.class); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePerson(String largePersonGroupId, String personId, String name, String userData) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest updatePersonRequestObj = new UpdatePersonRequest().setName(name).setUserData(userData); + BinaryData updatePersonRequest = BinaryData.fromObject(updatePersonRequestObj); + updatePersonWithResponse(largePersonGroupId, personId, updatePersonRequest, requestOptions).getValue(); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePerson(String largePersonGroupId, String personId) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest updatePersonRequestObj = new UpdatePersonRequest(); + BinaryData updatePersonRequest = BinaryData.fromObject(updatePersonRequestObj); + updatePersonWithResponse(largePersonGroupId, personId, updatePersonRequest, requestOptions).getValue(); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * for more details. + * + * @param largePersonGroupId ID of the container. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersons(String largePersonGroupId, String start, Integer top) { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getPersonsWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * for more details. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersons(String largePersonGroupId) { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonsWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceFromUrlImpl(String largePersonGroupId, String personId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceFromUrlRequest addFaceFromUrlRequestObj = new AddFaceFromUrlRequest(url); + BinaryData addFaceFromUrlRequest = BinaryData.fromObject(addFaceFromUrlRequestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceFromUrlImplWithResponse(largePersonGroupId, personId, addFaceFromUrlRequest, requestOptions) + .getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceFromUrlImpl(String largePersonGroupId, 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(largePersonGroupId, personId, addFaceFromUrlRequest, requestOptions) + .getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceImpl(String largePersonGroupId, String personId, BinaryData imageContent, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceImplWithResponse(largePersonGroupId, personId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AddFaceResult addFaceImpl(String largePersonGroupId, String personId, BinaryData imageContent) { + // Generated convenience method for addFaceImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addFaceImplWithResponse(largePersonGroupId, personId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for deleteFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions).getValue(); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large person group person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroupPersonFace getFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for getFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions).getValue() + .toObject(LargePersonGroupPersonFace.class); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateFace(String largePersonGroupId, 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(largePersonGroupId, personId, persistedFaceId, updateFaceRequest, requestOptions) + .getValue(); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for updateFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest(); + BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); + updateFaceWithResponse(largePersonGroupId, personId, persistedFaceId, updateFaceRequest, requestOptions) + .getValue(); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON + = new TypeReference>() { + }; +} 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 new file mode 100644 index 0000000000000..8cacd93615778 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.ai.vision.face.FaceServiceVersion; +import com.azure.core.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.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; + +/** + * Initializes a new instance of the FaceAdministrationClient type. + */ +public final class FaceAdministrationClientImpl { + /** + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final FaceServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public FaceServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * 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 serviceVersion Service version. + */ + public FaceAdministrationClientImpl(String endpoint, FaceServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceAdministrationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceAdministrationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + FaceServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.largeFaceLists = new LargeFaceListsImpl(this); + this.largePersonGroups = new LargePersonGroupsImpl(this); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java index 59f5eaf17af4d..969da262c69ff 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java @@ -257,50 +257,93 @@ Response groupSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData groupRequest, RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> findSimilarFromLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData findSimilarFromLargeFaceListRequest, + RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response findSimilarFromLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData findSimilarFromLargeFaceListRequest, + RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> identifyFromLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData identifyFromLargePersonGroupRequest, + RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response identifyFromLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData identifyFromLargePersonGroupRequest, + RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> verifyFromLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData verifyFromLargePersonGroupRequest, RequestOptions requestOptions, + Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response verifyFromLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData verifyFromLargePersonGroupRequest, RequestOptions requestOptions, + Context context); } /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more + * details. *

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -450,45 +493,16 @@ public Mono> detectFromUrlImplWithResponseAsync(BinaryData /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more + * details. *

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -638,45 +652,15 @@ public Response detectFromUrlImplWithResponse(BinaryData detectFromU /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. *

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -824,45 +808,15 @@ public Mono> detectImplWithResponseAsync(BinaryData imageCo /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * > [!IMPORTANT] - * > Microsoft has retired or limited facial recognition capabilities that can be used to try to infer emotional - * states and identity attributes which, if misused, can subject people to stereotyping, discrimination or unfair - * denial of services. The retired capabilities are emotion and gender. The limited capabilities are age, smile, - * facial hair, hair and makeup. Email Azure Face API <azureface@microsoft.com> if you have a responsible - * use case that would benefit from the use of any of the limited capabilities. Read more about this decision - * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. - * - * * - * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an - * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face - * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. - * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, - * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific - * attributes may not be highly accurate. - * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. - * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with - * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. - * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. - * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use - * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). - * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer - * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model - * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. - * * 'detection_03': Face attributes (mask, blur, and headPose) and landmarks are supported if you choose this - * detection model. - * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find - * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value - * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need - * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. - * More details, please refer to - * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. *

Query Parameters

* * * * + * 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". *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default - * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is @@ -1010,16 +964,8 @@ public Response detectImplWithResponse(BinaryData imageContent, Requ * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the * faces created by Detect. * - * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. - * - * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it - * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find - * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. - * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is - * low. It can be used in the cases like searching celebrity-looking faces. - * - * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the - * target faceId array. + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * details. *

Request Body Schema

* *
{@code
@@ -1066,16 +1012,8 @@ public Mono> findSimilarWithResponseAsync(BinaryData findSi
      * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the
      * faces created by Detect.
      * 
-     * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity.
-     * 
-     * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it
-     * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find
-     * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds.
-     * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is
-     * low. It can be used in the cases like searching celebrity-looking faces.
-     * 
-     * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
-     * target faceId array.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more
+     * details.
      * 

Request Body Schema

* *
{@code
@@ -1120,13 +1058,8 @@ public Response findSimilarWithResponse(BinaryData findSimilarReques
     /**
      * Verify whether two faces belong to a same person.
      * 
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Higher face image quality means better identification precision. Please consider high-quality faces:
-     * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
-     * > * For the scenarios that are sensitive to accuracy please make your own judgment.
-     * > * The 'recognitionModel' associated with the both faces should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for
+     * more details.
      * 

Request Body Schema

* *
{@code
@@ -1166,13 +1099,8 @@ public Mono> verifyFaceToFaceWithResponseAsync(BinaryData v
     /**
      * Verify whether two faces belong to a same person.
      * 
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Higher face image quality means better identification precision. Please consider high-quality faces:
-     * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
-     * > * For the scenarios that are sensitive to accuracy please make your own judgment.
-     * > * The 'recognitionModel' associated with the both faces should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for
+     * more details.
      * 

Request Body Schema

* *
{@code
@@ -1211,16 +1139,7 @@ public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceTo
     /**
      * Divide candidate faces into groups based on face similarity.
      * 
-     * >
-     * *
-     * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have
-     * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice
-     * that faces belonging to a same person might be split into several groups in the result.
-     * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original
-     * faces. The messyGroup will not appear in the result if all faces found their counterparts.
-     * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you
-     * only have 2 candidate faces.
-     * * The 'recognitionModel' associated with the query faces' faceIds should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details.
      * 

Request Body Schema

* *
{@code
@@ -1266,16 +1185,7 @@ public Mono> groupWithResponseAsync(BinaryData groupRequest
     /**
      * Divide candidate faces into groups based on face similarity.
      * 
-     * >
-     * *
-     * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have
-     * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice
-     * that faces belonging to a same person might be split into several groups in the result.
-     * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original
-     * faces. The messyGroup will not appear in the result if all faces found their counterparts.
-     * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you
-     * only have 2 candidate faces.
-     * * The 'recognitionModel' associated with the query faces' faceIds should be the same.
+     * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details.
      * 

Request Body Schema

* *
{@code
@@ -1316,4 +1226,287 @@ public Response groupWithResponse(BinaryData groupRequest, RequestOp
         return service.groupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept,
             groupRequest, requestOptions, Context.NONE);
     }
+
+    /**
+     * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is
+     * created by Create Large Face List.
+     * 
+     * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceListWithResponseAsync( + BinaryData findSimilarFromLargeFaceListRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.findSimilarFromLargeFaceList(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, findSimilarFromLargeFaceListRequest, requestOptions, context)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarFromLargeFaceListWithResponse(BinaryData findSimilarFromLargeFaceListRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.findSimilarFromLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, findSimilarFromLargeFaceListRequest, requestOptions, Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroupWithResponseAsync( + BinaryData identifyFromLargePersonGroupRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.identifyFromLargePersonGroup(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, identifyFromLargePersonGroupRequest, requestOptions, context)); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromLargePersonGroupWithResponse(BinaryData identifyFromLargePersonGroupRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.identifyFromLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, identifyFromLargePersonGroupRequest, requestOptions, Context.NONE); + } + + /** + * 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 verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromLargePersonGroupWithResponseAsync( + BinaryData verifyFromLargePersonGroupRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.verifyFromLargePersonGroup(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, verifyFromLargePersonGroupRequest, requestOptions, context)); + } + + /** + * 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 verify result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromLargePersonGroupWithResponse(BinaryData verifyFromLargePersonGroupRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.verifyFromLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, verifyFromLargePersonGroupRequest, requestOptions, Context.NONE); + } } 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 39a6f806dd248..1b6de5e0c5a8b 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 @@ -379,25 +379,57 @@ Mono> getLivenessWithVerifySessionAuditEntries(@HostParam(" 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 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectFromSessionImage(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData detectFromSessionImageRequest, RequestOptions requestOptions, + Context context); + + @Post("/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectFromSessionImageSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData detectFromSessionImageRequest, RequestOptions requestOptions, + Context context); + + @Get("/session/sessionImages/{sessionImageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSessionImage(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionImageId") String sessionImageId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/session/sessionImages/{sessionImageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSessionImageSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionImageId") String sessionImageId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** * Create a new detect liveness session. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLiveness/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To - * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your - * resource, use the List Liveness Session Audit Entries. + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for + * more details. *

Request Body Schema

* *
{@code
@@ -442,20 +474,8 @@ public Mono> createLivenessSessionWithResponseAsync(BinaryD
     /**
      * Create a new detect liveness session.
      * 
-     * A session is best for client device scenarios where developers want to authorize a client device to perform only
-     * a liveness detection without granting full access to their resource. Created sessions have a limited life span
-     * and only authorize clients to perform the desired action before access is expired.
-     * 
-     * Permissions includes...
-     * >
-     * *
-     * * Ability to call /detectLiveness/singleModal for up to 3 retries.
-     * * A token lifetime of 10 minutes.
-     * 
-     * > [!NOTE]
-     * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To
-     * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your
-     * resource, use the List Liveness Session Audit Entries.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for
+     * more details.
      * 

Request Body Schema

* *
{@code
@@ -498,11 +518,8 @@ public Response createLivenessSessionWithResponse(BinaryData body, R
     /**
      * Delete all session related information for matching the specified session id.
      * 
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -523,11 +540,8 @@ public Mono> deleteLivenessSessionWithResponseAsync(String sessio
     /**
      * Delete all session related information for matching the specified session id.
      * 
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -545,7 +559,8 @@ public Response deleteLivenessSessionWithResponse(String sessionId, Reques
     }
 
     /**
-     * Get session result of detectLiveness/singleModal call.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result
+     * for more details.
      * 

Response Body Schema

* *
{@code
@@ -613,8 +628,7 @@ public Response deleteLivenessSessionWithResponse(String sessionId, Reques
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLiveness/singleModal call along with {@link Response} on successful completion of
-     * {@link Mono}.
+     * @return session result of detect liveness along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getLivenessSessionResultWithResponseAsync(String sessionId,
@@ -625,7 +639,8 @@ public Mono> getLivenessSessionResultWithResponseAsync(Stri
     }
 
     /**
-     * Get session result of detectLiveness/singleModal call.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result
+     * for more details.
      * 

Response Body Schema

* *
{@code
@@ -693,7 +708,7 @@ public Mono> getLivenessSessionResultWithResponseAsync(Stri
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLiveness/singleModal call along with {@link Response}.
+     * @return session result of detect liveness along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getLivenessSessionResultWithResponse(String sessionId, RequestOptions requestOptions) {
@@ -705,9 +720,8 @@ public Response getLivenessSessionResultWithResponse(String sessionI
     /**
      * Lists sessions for /detectLiveness/SingleModal.
      * 
-     * List sessions from the last sessionId greater than the 'start'.
-     * 
-     * The result should be ordered by sessionId in ascending order.
+     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for
+     * more details.
      * 

Query Parameters

* * @@ -750,9 +764,8 @@ public Mono> getLivenessSessionsWithResponseAsync(RequestOp /** * Lists sessions for /detectLiveness/SingleModal. * - * List sessions from the last sessionId greater than the 'start'. - * - * The result should be ordered by sessionId in ascending order. + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for + * more details. *

Query Parameters

*
Query Parameters
* @@ -793,7 +806,9 @@ public Response getLivenessSessionsWithResponse(RequestOptions reque } /** - * Gets session requests and response body for the session. + * 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
* @@ -864,8 +879,7 @@ 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 session requests and response body for the session along with {@link Response} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLivenessSessionAuditEntriesWithResponseAsync(String sessionId, @@ -876,7 +890,9 @@ public Mono> getLivenessSessionAuditEntriesWithResponseAsyn } /** - * Gets session requests and response body for the session. + * 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
* @@ -947,7 +963,7 @@ 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 session requests and response body for the session along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getLivenessSessionAuditEntriesWithResponse(String sessionId, @@ -961,28 +977,9 @@ public Response getLivenessSessionAuditEntriesWithResponse(String se * Create a new liveness session with verify. Client device submits VerifyImage during the * /detectLivenessWithVerify/singleModal call. * - * A session is best for client device scenarios where developers want to authorize a client device to perform only - * a liveness detection without granting full access to their resource. Created sessions have a limited life span - * and only authorize clients to perform the desired action before access is expired. - * - * Permissions includes... - * > - * * - * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. - * * A token lifetime of 10 minutes. - * - * > [!NOTE] - * > - * > * - * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session - * operation. - * > * To retrieve a result, use the Get Liveness With Verify Session. - * > * To audit the individual requests that a client has made to your resource, use the List Liveness With - * Verify Session Audit Entries. - * - * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. - * > [!NOTE] - * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * 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
@@ -1039,28 +1036,9 @@ public Mono> createLivenessWithVerifySessionWithResponseAsy
      * Create a new liveness session with verify. Client device submits VerifyImage during the
      * /detectLivenessWithVerify/singleModal call.
      * 
-     * A session is best for client device scenarios where developers want to authorize a client device to perform only
-     * a liveness detection without granting full access to their resource. Created sessions have a limited life span
-     * and only authorize clients to perform the desired action before access is expired.
-     * 
-     * Permissions includes...
-     * >
-     * *
-     * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries.
-     * * A token lifetime of 10 minutes.
-     * 
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session
-     * operation.
-     * > * To retrieve a result, use the Get Liveness With Verify Session.
-     * > * To audit the individual requests that a client has made to your resource, use the List Liveness With
-     * Verify Session Audit Entries.
-     * 
-     * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call.
-     * > [!NOTE]
-     * > Extra measures should be taken to validate that the client is sending the expected VerifyImage.
+     * 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
@@ -1115,26 +1093,9 @@ public Response createLivenessWithVerifySessionWithResponse(BinaryDa
     /**
      * Create a new liveness session with verify. Provide the verify image during session creation.
      * 
-     * A session is best for client device scenarios where developers want to authorize a client device to perform only
-     * a liveness detection without granting full access to their resource. Created sessions have a limited life span
-     * and only authorize clients to perform the desired action before access is expired.
-     * 
-     * Permissions includes...
-     * >
-     * *
-     * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries.
-     * * A token lifetime of 10 minutes.
-     * 
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session
-     * operation.
-     * > * To retrieve a result, use the Get Liveness With Verify Session.
-     * > * To audit the individual requests that a client has made to your resource, use the List Liveness With
-     * Verify Session Audit Entries.
-     * 
-     * Recommended Option: VerifyImage is provided during session creation.
+     * 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
@@ -1175,26 +1136,9 @@ public Mono> createLivenessWithVerifySessionWithVerifyImage
     /**
      * Create a new liveness session with verify. Provide the verify image during session creation.
      * 
-     * A session is best for client device scenarios where developers want to authorize a client device to perform only
-     * a liveness detection without granting full access to their resource. Created sessions have a limited life span
-     * and only authorize clients to perform the desired action before access is expired.
-     * 
-     * Permissions includes...
-     * >
-     * *
-     * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries.
-     * * A token lifetime of 10 minutes.
-     * 
-     * > [!NOTE]
-     * >
-     * > *
-     * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session
-     * operation.
-     * > * To retrieve a result, use the Get Liveness With Verify Session.
-     * > * To audit the individual requests that a client has made to your resource, use the List Liveness With
-     * Verify Session Audit Entries.
-     * 
-     * Recommended Option: VerifyImage is provided during session creation.
+     * 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
@@ -1233,11 +1177,9 @@ public Response createLivenessWithVerifySessionWithVerifyImageWithRe
     /**
      * Delete all session related information for matching the specified session id.
      * 
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -1258,11 +1200,9 @@ public Mono> deleteLivenessWithVerifySessionWithResponseAsync(Str
     /**
      * Delete all session related information for matching the specified session id.
      * 
-     * > [!NOTE]
-     * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth
-     * Token. While this can be used to remove any access for that token, those requests will still count towards
-     * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is
-     * misused.
+     * 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.
@@ -1280,7 +1220,9 @@ public Response deleteLivenessWithVerifySessionWithResponse(String session
     }
 
     /**
-     * Get session result of detectLivenessWithVerify/singleModal call.
+     * 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
@@ -1348,8 +1290,8 @@ public Response deleteLivenessWithVerifySessionWithResponse(String session
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response} on successful
-     * completion of {@link Mono}.
+     * @return session result of detect liveness with verify along with {@link Response} on successful completion of
+     * {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getLivenessWithVerifySessionResultWithResponseAsync(String sessionId,
@@ -1360,7 +1302,9 @@ public Mono> getLivenessWithVerifySessionResultWithResponse
     }
 
     /**
-     * Get session result of detectLivenessWithVerify/singleModal call.
+     * 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
@@ -1428,7 +1372,7 @@ public Mono> getLivenessWithVerifySessionResultWithResponse
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response}.
+     * @return session result of detect liveness with verify along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getLivenessWithVerifySessionResultWithResponse(String sessionId,
@@ -1441,9 +1385,9 @@ public Response getLivenessWithVerifySessionResultWithResponse(Strin
     /**
      * Lists sessions for /detectLivenessWithVerify/SingleModal.
      * 
-     * List sessions from the last sessionId greater than the "start".
-     * 
-     * The result should be ordered by sessionId in ascending order.
+     * 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
* @@ -1486,9 +1430,9 @@ public Mono> getLivenessWithVerifySessionsWithResponseAsync /** * Lists sessions for /detectLivenessWithVerify/SingleModal. * - * List sessions from the last sessionId greater than the "start". - * - * The result should be ordered by sessionId in ascending order. + * 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
* @@ -1529,7 +1473,9 @@ public Response getLivenessWithVerifySessionsWithResponse(RequestOpt } /** - * Gets session requests and response body for the session. + * 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
* @@ -1600,8 +1546,7 @@ public Response getLivenessWithVerifySessionsWithResponse(RequestOpt * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return session requests and response body for the session along with {@link Response} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLivenessWithVerifySessionAuditEntriesWithResponseAsync(String sessionId, @@ -1612,7 +1557,9 @@ public Mono> getLivenessWithVerifySessionAuditEntriesWithRe } /** - * Gets session requests and response body for the session. + * 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
* @@ -1683,7 +1630,7 @@ public Mono> getLivenessWithVerifySessionAuditEntriesWithRe * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return session requests and response body for the session along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getLivenessWithVerifySessionAuditEntriesWithResponse(String sessionId, @@ -1692,4 +1639,372 @@ public Response getLivenessWithVerifySessionAuditEntriesWithResponse 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. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-session-image-id + * for more details. + *

Query Parameters

+ *
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
+     * {
+     *     sessionImageId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param detectFromSessionImageRequest The detectFromSessionImageRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectFromSessionImageWithResponseAsync(BinaryData detectFromSessionImageRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.detectFromSessionImage(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, detectFromSessionImageRequest, requestOptions, context)); + } + + /** + * 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-session-image-id + * 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
+     * {
+     *     sessionImageId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param detectFromSessionImageRequest The detectFromSessionImageRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectFromSessionImageWithResponse(BinaryData detectFromSessionImageRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.detectFromSessionImageSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, detectFromSessionImageRequest, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + * @param sessionImageId The request ID of the image to be retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> getSessionImageWithResponseAsync(String sessionImageId, + RequestOptions requestOptions) { + final String accept = "application/octet-stream"; + return FluxUtil.withContext(context -> service.getSessionImage(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionImageId, accept, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-session-image for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + * @param sessionImageId The request ID of the image to be retrieved. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 getSessionImageWithResponse(String sessionImageId, RequestOptions requestOptions) { + final String accept = "application/octet-stream"; + return service.getSessionImageSync(this.getEndpoint(), this.getServiceVersion().getVersion(), sessionImageId, + accept, requestOptions, Context.NONE); + } } 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/LargeFaceListsImpl.java new file mode 100644 index 0000000000000..10c7238f12f28 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListsImpl.java @@ -0,0 +1,1373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.ai.vision.face.FaceServiceVersion; +import com.azure.ai.vision.face.models.FaceTrainingResult; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LargeFaceLists. + */ +public final class LargeFaceListsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final LargeFaceListsService service; + + /** + * The service client containing this operation class. + */ + private final FaceAdministrationClientImpl client; + + /** + * Initializes an instance of LargeFaceListsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LargeFaceListsImpl(FaceAdministrationClientImpl client) { + this.service + = RestProxy.create(LargeFaceListsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public FaceServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for FaceAdministrationClientLargeFaceLists to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}/face/{apiVersion}") + @ServiceInterface(name = "FaceAdministrationCl") + public interface LargeFaceListsService { + @Put("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + RequestOptions requestOptions, Context context); + + @Put("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + RequestOptions requestOptions, Context context); + + @Delete("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargeFaceLists(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargeFaceListsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTrainingStatus(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getTrainingStatusSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> train(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addFaceImpl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, + Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addFaceImplSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, + Context context); + + @Delete("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFaces(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFacesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> createWithResponseAsync(String largeFaceListId, 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(), + largeFaceListId, contentType, accept, createRequest1, requestOptions, context)); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 createWithResponse(String largeFaceListId, BinaryData createRequest1, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, contentType, accept, createRequest1, requestOptions, Context.NONE); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list for more + * details. + *

Query Parameters

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

Response Body Schema

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

Query Parameters

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

Response Body Schema

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

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> updateWithResponseAsync(String largeFaceListId, 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(), + largeFaceListId, contentType, accept, updateRequest1, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 updateWithResponse(String largeFaceListId, BinaryData updateRequest1, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, contentType, accept, updateRequest1, requestOptions, Context.NONE); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargeFaceLists(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-lists 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargeFaceListsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-training-status for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTrainingStatusWithResponseAsync(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTrainingStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-training-status for more + * details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainingStatusWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getTrainingStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> trainWithResponseAsync(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.train(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response trainWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.trainSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainAsync(String largeFaceListId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainWithResponseAsync(largeFaceListId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String largeFaceListId, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainWithResponse(largeFaceListId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainWithModelAsync(String largeFaceListId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainWithResponseAsync(largeFaceListId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Submit a Large Face List training task. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/train-large-face-list for more + * details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainWithModel(String largeFaceListId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainWithResponse(largeFaceListId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceFromUrlImplWithResponseAsync(String largeFaceListId, + 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(), largeFaceListId, contentType, accept, addFaceFromUrlRequest1, + requestOptions, context)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face-from-url + * for more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param 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. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceFromUrlImplWithResponse(String largeFaceListId, + BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.addFaceFromUrlImplSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, contentType, accept, addFaceFromUrlRequest1, requestOptions, Context.NONE); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceImplWithResponseAsync(String largeFaceListId, BinaryData imageContent, + 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(), + largeFaceListId, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/add-large-face-list-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceImplWithResponse(String largeFaceListId, 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(), + largeFaceListId, contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceWithResponseAsync(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deleteFace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/delete-large-face-list-face for + * more details. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-face for more + * details. + *

Response Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> updateFaceWithResponseAsync(String largeFaceListId, String persistedFaceId, + 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(), + largeFaceListId, persistedFaceId, contentType, accept, updateFaceRequest1, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/update-large-face-list-face for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 updateFaceWithResponse(String largeFaceListId, 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(), + largeFaceListId, persistedFaceId, contentType, accept, updateFaceRequest1, requestOptions, Context.NONE); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces 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){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFacesWithResponseAsync(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getFaces(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/get-large-face-list-faces 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){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFacesWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFacesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largeFaceListId, 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/LargePersonGroupsImpl.java new file mode 100644 index 0000000000000..2cd3391e3b3c0 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupsImpl.java @@ -0,0 +1,1780 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.ai.vision.face.FaceServiceVersion; +import com.azure.ai.vision.face.models.FaceTrainingResult; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LargePersonGroups. + */ +public final class LargePersonGroupsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final LargePersonGroupsService service; + + /** + * The service client containing this operation class. + */ + private final FaceAdministrationClientImpl client; + + /** + * Initializes an instance of LargePersonGroupsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LargePersonGroupsImpl(FaceAdministrationClientImpl client) { + this.service + = RestProxy.create(LargePersonGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public FaceServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for FaceAdministrationClientLargePersonGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}/face/{apiVersion}") + @ServiceInterface(name = "FaceAdministrationCl") + public interface LargePersonGroupsService { + @Put("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + RequestOptions requestOptions, Context context); + + @Put("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroups(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTrainingStatus(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getTrainingStatusSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> train(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createPerson(@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 createPersonRequest, RequestOptions requestOptions, + Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createPersonSync(@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 createPersonRequest, RequestOptions requestOptions, + Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deletePerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deletePersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updatePerson(@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 updatePersonRequest, + RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updatePersonSync(@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 updatePersonRequest, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersons(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addFaceImpl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addFaceImplSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> 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, + Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response 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, + Context context); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> createWithResponseAsync(String largePersonGroupId, 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(), + largePersonGroupId, contentType, accept, createRequest, requestOptions, context)); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 createWithResponse(String largePersonGroupId, BinaryData createRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, contentType, accept, createRequest, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + *

Query Parameters

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group for more + * details. + *

Query Parameters

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @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. + * @throws ResourceNotFoundException thrown if the request 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> updateWithResponseAsync(String largePersonGroupId, 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(), + largePersonGroupId, contentType, accept, updateRequest, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group for + * more details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @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. + * @throws ResourceNotFoundException thrown if the request 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 updateWithResponse(String largePersonGroupId, BinaryData updateRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, contentType, accept, updateRequest, requestOptions, Context.NONE); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargePersonGroups(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-groups 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.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-training-status for more + * details. + *

Response Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTrainingStatusWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getTrainingStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> trainWithResponseAsync(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.train(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response trainWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.trainSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainAsync(String largePersonGroupId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainWithResponseAsync(largePersonGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrain(String largePersonGroupId, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainWithResponse(largePersonGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainWithModelAsync(String largePersonGroupId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainWithResponseAsync(largePersonGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/train-large-person-group for + * more details. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainWithModel(String largePersonGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainWithResponse(largePersonGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) + .replace("{apiVersion}", this.client.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)); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + *

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param createPersonRequest The createPersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createPersonWithResponseAsync(String largePersonGroupId, + BinaryData createPersonRequest, 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(), + largePersonGroupId, contentType, accept, createPersonRequest, requestOptions, context)); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group-person for more + * details. + *

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param createPersonRequest The createPersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createPersonWithResponse(String largePersonGroupId, BinaryData createPersonRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createPersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, contentType, accept, createPersonRequest, requestOptions, Context.NONE); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonWithResponseAsync(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deletePerson(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, requestOptions, context)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deletePersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person + * for more details. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified large person group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonWithResponseAsync(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getPerson(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, requestOptions, context)); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person + * for more details. + *

Response Body Schema

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

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param updatePersonRequest The updatePersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonWithResponseAsync(String largePersonGroupId, String personId, + BinaryData updatePersonRequest, 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(), + largePersonGroupId, personId, contentType, accept, updatePersonRequest, requestOptions, context)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param updatePersonRequest The updatePersonRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonWithResponse(String largePersonGroupId, String personId, + BinaryData updatePersonRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updatePersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, contentType, accept, updatePersonRequest, requestOptions, Context.NONE); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * 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){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonsWithResponseAsync(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersons(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-persons + * 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){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonsWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceFromUrlImplWithResponseAsync(String largePersonGroupId, String personId, + BinaryData addFaceFromUrlRequest, 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(), largePersonGroupId, personId, contentType, accept, + addFaceFromUrlRequest, requestOptions, context)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face-from-url for + * more details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceFromUrlImplWithResponse(String largePersonGroupId, String personId, + BinaryData addFaceFromUrlRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.addFaceFromUrlImplSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, contentType, accept, addFaceFromUrlRequest, requestOptions, Context.NONE); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceImplWithResponseAsync(String largePersonGroupId, String personId, + BinaryData imageContent, 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(), + largePersonGroupId, personId, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/add-large-person-group-person-face for more + * details. + *

Query Parameters

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

Request Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceImplWithResponse(String largePersonGroupId, String personId, + 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(), + largePersonGroupId, personId, contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceWithResponseAsync(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deleteFace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/delete-large-person-group-person-face for more + * details. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceWithResponse(String largePersonGroupId, String personId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/get-large-person-group-person-face for more + * details. + *

Response Body Schema

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

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceWithResponse(String largePersonGroupId, String personId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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> updateFaceWithResponseAsync(String largePersonGroupId, String personId, + 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(), largePersonGroupId, personId, persistedFaceId, contentType, + accept, updateFaceRequest, requestOptions, context)); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/person-group-operations/update-large-person-group-person-face for more + * details. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param 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. + * @throws ResourceNotFoundException thrown if the request 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 updateFaceWithResponse(String largePersonGroupId, String personId, 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(), + largePersonGroupId, personId, persistedFaceId, contentType, accept, updateFaceRequest, 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/AddFaceFromUrlRequest.java new file mode 100644 index 0000000000000..7da8010e90b46 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest.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.implementation.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 AddFaceFromUrlRequest model. + */ +@Immutable +public final class AddFaceFromUrlRequest implements JsonSerializable { + + /* + * URL of input image. + */ + @Generated + private final String url; + + /** + * Creates an instance of AddFaceFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + public AddFaceFromUrlRequest(String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddFaceFromUrlRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddFaceFromUrlRequest 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 AddFaceFromUrlRequest. + */ + @Generated + public static AddFaceFromUrlRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String url = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("url".equals(fieldName)) { + url = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AddFaceFromUrlRequest(url); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest1.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest1.java new file mode 100644 index 0000000000000..0266fa04f850e --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest1.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.implementation.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 AddFaceFromUrlRequest1 model. + */ +@Immutable +public final class AddFaceFromUrlRequest1 implements JsonSerializable { + + /* + * URL of input image. + */ + @Generated + private final String url; + + /** + * Creates an instance of AddFaceFromUrlRequest1 class. + * + * @param url the url value to set. + */ + @Generated + public AddFaceFromUrlRequest1(String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddFaceFromUrlRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddFaceFromUrlRequest1 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 AddFaceFromUrlRequest1. + */ + @Generated + public static AddFaceFromUrlRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String url = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("url".equals(fieldName)) { + url = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AddFaceFromUrlRequest1(url); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionJsonContent.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionJsonContent.java deleted file mode 100644 index 16b2d0c26d286..0000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionJsonContent.java +++ /dev/null @@ -1,385 +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.LivenessModel; -import com.azure.ai.vision.face.models.LivenessOperationMode; -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. - */ -@Fluent -public final class CreateLivenessWithVerifySessionJsonContent - implements JsonSerializable { - /* - * Type of liveness mode the client should follow. - */ - @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. - */ - @Generated - private Boolean deviceCorrelationIdSetInClient; - - /* - * 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; - - /* - * 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; - - /* - * Whether or not return the verify image hash. - */ - @Generated - private Boolean returnVerifyImageHash; - - /* - * Threshold for confidence of the face verification. - */ - @Generated - private Double verifyConfidenceThreshold; - - /** - * Creates an instance of CreateLivenessWithVerifySessionJsonContent class. - * - * @param livenessOperationMode the livenessOperationMode value to set. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode livenessOperationMode) { - this.livenessOperationMode = livenessOperationMode; - } - - /** - * Get the livenessOperationMode property: Type of liveness mode the client should follow. - * - * @return the livenessOperationMode value. - */ - @Generated - public LivenessOperationMode getLivenessOperationMode() { - return this.livenessOperationMode; - } - - /** - * Get the sendResultsToClient property: Whether or not to allow a '200 - Success' response body to be sent to the - * client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' - * empty body response. Regardless of selection, calling Session GetResult will always contain a response body - * enabling business logic to be implemented. - * - * @return the sendResultsToClient value. - */ - @Generated - public Boolean isSendResultsToClient() { - return this.sendResultsToClient; - } - - /** - * Set the sendResultsToClient property: Whether or not to allow a '200 - Success' response body to be sent to the - * client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' - * empty body response. Regardless of selection, calling Session GetResult will always contain a response body - * enabling business logic to be implemented. - * - * @param sendResultsToClient the sendResultsToClient value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent setSendResultsToClient(Boolean sendResultsToClient) { - this.sendResultsToClient = sendResultsToClient; - return this; - } - - /** - * Get the deviceCorrelationIdSetInClient property: Whether or not to allow client to set their own - * 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request - * body. - * - * @return the deviceCorrelationIdSetInClient value. - */ - @Generated - public Boolean isDeviceCorrelationIdSetInClient() { - return this.deviceCorrelationIdSetInClient; - } - - /** - * Set the deviceCorrelationIdSetInClient property: Whether or not to allow client to set their own - * 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request - * body. - * - * @param deviceCorrelationIdSetInClient the deviceCorrelationIdSetInClient value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent - setDeviceCorrelationIdSetInClient(Boolean deviceCorrelationIdSetInClient) { - this.deviceCorrelationIdSetInClient = deviceCorrelationIdSetInClient; - return this; - } - - /** - * 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 CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent 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 CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent - setLivenessSingleModalModel(LivenessModel livenessSingleModalModel) { - this.livenessSingleModalModel = livenessSingleModalModel; - return this; - } - - /** - * Get the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and - * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be - * null. - * - * @return the deviceCorrelationId value. - */ - @Generated - public String getDeviceCorrelationId() { - return this.deviceCorrelationId; - } - - /** - * Set the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and - * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be - * null. - * - * @param deviceCorrelationId the deviceCorrelationId value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent setDeviceCorrelationId(String deviceCorrelationId) { - this.deviceCorrelationId = deviceCorrelationId; - return this; - } - - /** - * Get the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. - * Default value is 600. - * - * @return the authTokenTimeToLiveInSeconds value. - */ - @Generated - public Integer getAuthTokenTimeToLiveInSeconds() { - return this.authTokenTimeToLiveInSeconds; - } - - /** - * Set the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. - * Default value is 600. - * - * @param authTokenTimeToLiveInSeconds the authTokenTimeToLiveInSeconds value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent - setAuthTokenTimeToLiveInSeconds(Integer authTokenTimeToLiveInSeconds) { - this.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; - return this; - } - - /** - * Get the returnVerifyImageHash property: Whether or not return the verify image hash. - * - * @return the returnVerifyImageHash value. - */ - @Generated - public Boolean isReturnVerifyImageHash() { - return this.returnVerifyImageHash; - } - - /** - * Set the returnVerifyImageHash property: Whether or not return the verify image hash. - * - * @param returnVerifyImageHash the returnVerifyImageHash value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent setReturnVerifyImageHash(Boolean returnVerifyImageHash) { - this.returnVerifyImageHash = returnVerifyImageHash; - return this; - } - - /** - * Get the verifyConfidenceThreshold property: Threshold for confidence of the face verification. - * - * @return the verifyConfidenceThreshold value. - */ - @Generated - public Double getVerifyConfidenceThreshold() { - return this.verifyConfidenceThreshold; - } - - /** - * Set the verifyConfidenceThreshold property: Threshold for confidence of the face verification. - * - * @param verifyConfidenceThreshold the verifyConfidenceThreshold value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionJsonContent setVerifyConfidenceThreshold(Double verifyConfidenceThreshold) { - this.verifyConfidenceThreshold = verifyConfidenceThreshold; - return this; - } - - /** - * {@inheritDoc} - */ - @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(); - } - - /** - * Reads an instance of CreateLivenessWithVerifySessionJsonContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CreateLivenessWithVerifySessionJsonContent 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 CreateLivenessWithVerifySessionJsonContent. - */ - @Generated - public static CreateLivenessWithVerifySessionJsonContent 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(); - } - } - CreateLivenessWithVerifySessionJsonContent deserializedCreateLivenessWithVerifySessionJsonContent - = new CreateLivenessWithVerifySessionJsonContent(livenessOperationMode); - deserializedCreateLivenessWithVerifySessionJsonContent.sendResultsToClient = sendResultsToClient; - deserializedCreateLivenessWithVerifySessionJsonContent.deviceCorrelationIdSetInClient - = deviceCorrelationIdSetInClient; - deserializedCreateLivenessWithVerifySessionJsonContent.enableSessionImage = enableSessionImage; - deserializedCreateLivenessWithVerifySessionJsonContent.livenessSingleModalModel = livenessSingleModalModel; - deserializedCreateLivenessWithVerifySessionJsonContent.deviceCorrelationId = deviceCorrelationId; - deserializedCreateLivenessWithVerifySessionJsonContent.authTokenTimeToLiveInSeconds - = authTokenTimeToLiveInSeconds; - deserializedCreateLivenessWithVerifySessionJsonContent.returnVerifyImageHash = returnVerifyImageHash; - deserializedCreateLivenessWithVerifySessionJsonContent.verifyConfidenceThreshold - = verifyConfidenceThreshold; - - return deserializedCreateLivenessWithVerifySessionJsonContent; - }); - } -} 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 index 22220b8d3c298..4901bcb04ff2d 100644 --- 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.vision.face.implementation.models; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionJsonContent; +import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -17,7 +17,7 @@ public final class CreateLivenessWithVerifySessionMultipartContent { * The parameters for creating session. */ @Generated - private final CreateLivenessWithVerifySessionJsonContent parameters; + private final CreateLivenessWithVerifySessionContent parameters; /* * The image stream for verify. Content-Disposition header field for this part must have filename. @@ -25,26 +25,13 @@ public final class CreateLivenessWithVerifySessionMultipartContent { @Generated private final VerifyImageFileDetails verifyImage; - /** - * Creates an instance of CreateLivenessWithVerifySessionMultipartContent class. - * - * @param parameters the parameters value to set. - * @param verifyImage the verifyImage value to set. - */ - @Generated - public CreateLivenessWithVerifySessionMultipartContent(CreateLivenessWithVerifySessionJsonContent parameters, - VerifyImageFileDetails verifyImage) { - this.parameters = parameters; - this.verifyImage = verifyImage; - } - /** * Get the parameters property: The parameters for creating session. * * @return the parameters value. */ @Generated - public CreateLivenessWithVerifySessionJsonContent getParameters() { + public CreateLivenessWithVerifySessionContent getParameters() { return this.parameters; } @@ -58,4 +45,17 @@ public CreateLivenessWithVerifySessionJsonContent getParameters() { 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/CreatePersonRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonRequest.java new file mode 100644 index 0000000000000..ece54137ac356 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonRequest.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreatePersonRequest model. + */ +@Fluent +public final class CreatePersonRequest implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /** + * Creates an instance of CreatePersonRequest class. + * + * @param name the name value to set. + */ + @Generated + public CreatePersonRequest(String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreatePersonRequest object itself. + */ + @Generated + public CreatePersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreatePersonRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreatePersonRequest 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 CreatePersonRequest. + */ + @Generated + public static CreatePersonRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String userData = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("userData".equals(fieldName)) { + userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + CreatePersonRequest deserializedCreatePersonRequest = new CreatePersonRequest(name); + deserializedCreatePersonRequest.userData = userData; + return deserializedCreatePersonRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateRequest.java new file mode 100644 index 0000000000000..ed3e82e642717 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateRequest.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreateRequest model. + */ +@Fluent +public final class CreateRequest implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /* + * The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include + * 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. + * 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with + * 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + */ + @Generated + private FaceRecognitionModel recognitionModel; + + /** + * Creates an instance of CreateRequest class. + * + * @param name the name value to set. + */ + @Generated + public CreateRequest(String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateRequest object itself. + */ + @Generated + public CreateRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @param recognitionModel the recognitionModel value to set. + * @return the CreateRequest object itself. + */ + @Generated + public CreateRequest setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeStringField("recognitionModel", + this.recognitionModel == null ? null : this.recognitionModel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateRequest 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 CreateRequest. + */ + @Generated + public static CreateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String userData = null; + FaceRecognitionModel recognitionModel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("userData".equals(fieldName)) { + userData = reader.getString(); + } else if ("recognitionModel".equals(fieldName)) { + recognitionModel = FaceRecognitionModel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + CreateRequest deserializedCreateRequest = new CreateRequest(name); + deserializedCreateRequest.userData = userData; + deserializedCreateRequest.recognitionModel = recognitionModel; + return deserializedCreateRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateRequest1.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateRequest1.java new file mode 100644 index 0000000000000..5733dc10c3c22 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateRequest1.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreateRequest1 model. + */ +@Fluent +public final class CreateRequest1 implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /* + * The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include + * 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. + * 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with + * 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + */ + @Generated + private FaceRecognitionModel recognitionModel; + + /** + * Creates an instance of CreateRequest1 class. + * + * @param name the name value to set. + */ + @Generated + public CreateRequest1(String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateRequest1 object itself. + */ + @Generated + public CreateRequest1 setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @param recognitionModel the recognitionModel value to set. + * @return the CreateRequest1 object itself. + */ + @Generated + public CreateRequest1 setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeStringField("recognitionModel", + this.recognitionModel == null ? null : this.recognitionModel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateRequest1 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 CreateRequest1. + */ + @Generated + public static CreateRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String userData = null; + FaceRecognitionModel recognitionModel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("userData".equals(fieldName)) { + userData = reader.getString(); + } else if ("recognitionModel".equals(fieldName)) { + recognitionModel = FaceRecognitionModel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + CreateRequest1 deserializedCreateRequest1 = new CreateRequest1(name); + deserializedCreateRequest1.userData = userData; + deserializedCreateRequest1.recognitionModel = recognitionModel; + return deserializedCreateRequest1; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromSessionImageRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromSessionImageRequest.java new file mode 100644 index 0000000000000..359fa8d74919c --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromSessionImageRequest.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.implementation.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 DetectFromSessionImageRequest model. + */ +@Immutable +public final class DetectFromSessionImageRequest implements JsonSerializable { + + /* + * Id of session image. + */ + @Generated + private final String sessionImageId; + + /** + * Creates an instance of DetectFromSessionImageRequest class. + * + * @param sessionImageId the sessionImageId value to set. + */ + @Generated + public DetectFromSessionImageRequest(String sessionImageId) { + this.sessionImageId = sessionImageId; + } + + /** + * Get the sessionImageId property: Id of session image. + * + * @return the sessionImageId value. + */ + @Generated + public String getSessionImageId() { + return this.sessionImageId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sessionImageId", this.sessionImageId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectFromSessionImageRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectFromSessionImageRequest 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 DetectFromSessionImageRequest. + */ + @Generated + public static DetectFromSessionImageRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String sessionImageId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("sessionImageId".equals(fieldName)) { + sessionImageId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new DetectFromSessionImageRequest(sessionImageId); + }); + } +} 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 a4f1667f20052..b658737d977a2 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 @@ -24,7 +24,8 @@ public final class DetectFromUrlImplOptions { /* * 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_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. */ @Generated private FaceDetectionModel detectionModel; @@ -93,7 +94,8 @@ public String getUrl() { /** * 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 - * 'detection_01'. + * 'detection_01'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 pixels) and + * rotated face orientations. * * @return the detectionModel value. */ @@ -105,7 +107,8 @@ public FaceDetectionModel getDetectionModel() { /** * Set 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 - * 'detection_01'. + * 'detection_01'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 pixels) and + * rotated face orientations. * * @param detectionModel the detectionModel value to set. * @return the DetectFromUrlImplOptions object itself. diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromLargeFaceListRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromLargeFaceListRequest.java new file mode 100644 index 0000000000000..8b86b5e070868 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromLargeFaceListRequest.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FindSimilarMatchMode; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The FindSimilarFromLargeFaceListRequest model. + */ +@Fluent +public final class FindSimilarFromLargeFaceListRequest + implements JsonSerializable { + + /* + * faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this faceId is not + * persisted and will expire 24 hours after the detection call. + */ + @Generated + private final String faceId; + + /* + * The number of top similar faces returned. The valid range is [1, 1000]. Default value is 20. + */ + @Generated + private Integer maxNumOfCandidatesReturned; + + /* + * Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + */ + @Generated + private FindSimilarMatchMode mode; + + /* + * An existing user-specified unique candidate Large Face List, created in "Create Large Face List". Large Face List + * contains a set of persistedFaceIds which are persisted and will never expire. + */ + @Generated + private final String largeFaceListId; + + /** + * Creates an instance of FindSimilarFromLargeFaceListRequest class. + * + * @param faceId the faceId value to set. + * @param largeFaceListId the largeFaceListId value to set. + */ + @Generated + public FindSimilarFromLargeFaceListRequest(String faceId, String largeFaceListId) { + this.faceId = faceId; + this.largeFaceListId = largeFaceListId; + } + + /** + * Get the faceId property: faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note + * that this faceId is not persisted and will expire 24 hours after the detection call. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the FindSimilarFromLargeFaceListRequest object itself. + */ + @Generated + public FindSimilarFromLargeFaceListRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @return the mode value. + */ + @Generated + public FindSimilarMatchMode getMode() { + return this.mode; + } + + /** + * Set the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @param mode the mode value to set. + * @return the FindSimilarFromLargeFaceListRequest object itself. + */ + @Generated + public FindSimilarFromLargeFaceListRequest setMode(FindSimilarMatchMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the largeFaceListId property: An existing user-specified unique candidate Large Face List, created in "Create + * Large Face List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * + * @return the largeFaceListId value. + */ + @Generated + public String getLargeFaceListId() { + return this.largeFaceListId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("faceId", this.faceId); + jsonWriter.writeStringField("largeFaceListId", this.largeFaceListId); + jsonWriter.writeNumberField("maxNumOfCandidatesReturned", this.maxNumOfCandidatesReturned); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FindSimilarFromLargeFaceListRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FindSimilarFromLargeFaceListRequest 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 FindSimilarFromLargeFaceListRequest. + */ + @Generated + public static FindSimilarFromLargeFaceListRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String faceId = null; + String largeFaceListId = null; + Integer maxNumOfCandidatesReturned = null; + FindSimilarMatchMode mode = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("faceId".equals(fieldName)) { + faceId = reader.getString(); + } else if ("largeFaceListId".equals(fieldName)) { + largeFaceListId = reader.getString(); + } else if ("maxNumOfCandidatesReturned".equals(fieldName)) { + maxNumOfCandidatesReturned = reader.getNullable(JsonReader::getInt); + } else if ("mode".equals(fieldName)) { + mode = FindSimilarMatchMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FindSimilarFromLargeFaceListRequest deserializedFindSimilarFromLargeFaceListRequest + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId); + deserializedFindSimilarFromLargeFaceListRequest.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + deserializedFindSimilarFromLargeFaceListRequest.mode = mode; + return deserializedFindSimilarFromLargeFaceListRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromLargePersonGroupRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromLargePersonGroupRequest.java new file mode 100644 index 0000000000000..ecae09d677494 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromLargePersonGroupRequest.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.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 IdentifyFromLargePersonGroupRequest model. + */ +@Fluent +public final class IdentifyFromLargePersonGroupRequest + implements JsonSerializable { + + /* + * Array of query faces faceIds, created by the "Detect". Each of the faces are identified independently. The valid + * number of faceIds is between [1, 10]. + */ + @Generated + private final List faceIds; + + /* + * largePersonGroupId of the target Large Person Group, created by "Create Large Person Group". Parameter + * personGroupId and largePersonGroupId should not be provided at the same time. + */ + @Generated + private final String largePersonGroupId; + + /* + * The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is 10. + */ + @Generated + private Integer maxNumOfCandidatesReturned; + + /* + * Customized identification confidence threshold, in the range of [0, 1]. Advanced user can tweak this value to + * override default internal threshold for better precision on their scenario data. Note there is no guarantee of + * this threshold value working on other data and after algorithm updates. + */ + @Generated + private Double confidenceThreshold; + + /** + * Creates an instance of IdentifyFromLargePersonGroupRequest class. + * + * @param faceIds the faceIds value to set. + * @param largePersonGroupId the largePersonGroupId value to set. + */ + @Generated + public IdentifyFromLargePersonGroupRequest(List faceIds, String largePersonGroupId) { + this.faceIds = faceIds; + this.largePersonGroupId = largePersonGroupId; + } + + /** + * Get the faceIds property: Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } + + /** + * Get the largePersonGroupId property: largePersonGroupId of the target Large Person Group, created by "Create + * Large Person Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * + * @return the largePersonGroupId value. + */ + @Generated + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the IdentifyFromLargePersonGroupRequest object itself. + */ + @Generated + public IdentifyFromLargePersonGroupRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @return the confidenceThreshold value. + */ + @Generated + public Double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the IdentifyFromLargePersonGroupRequest object itself. + */ + @Generated + public IdentifyFromLargePersonGroupRequest setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("faceIds", this.faceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("largePersonGroupId", this.largePersonGroupId); + jsonWriter.writeNumberField("maxNumOfCandidatesReturned", this.maxNumOfCandidatesReturned); + jsonWriter.writeNumberField("confidenceThreshold", this.confidenceThreshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentifyFromLargePersonGroupRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentifyFromLargePersonGroupRequest 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 IdentifyFromLargePersonGroupRequest. + */ + @Generated + public static IdentifyFromLargePersonGroupRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List faceIds = null; + String largePersonGroupId = null; + Integer maxNumOfCandidatesReturned = null; + Double confidenceThreshold = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("faceIds".equals(fieldName)) { + faceIds = reader.readArray(reader1 -> reader1.getString()); + } else if ("largePersonGroupId".equals(fieldName)) { + largePersonGroupId = reader.getString(); + } else if ("maxNumOfCandidatesReturned".equals(fieldName)) { + maxNumOfCandidatesReturned = reader.getNullable(JsonReader::getInt); + } else if ("confidenceThreshold".equals(fieldName)) { + confidenceThreshold = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + IdentifyFromLargePersonGroupRequest deserializedIdentifyFromLargePersonGroupRequest + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId); + deserializedIdentifyFromLargePersonGroupRequest.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + deserializedIdentifyFromLargePersonGroupRequest.confidenceThreshold = confidenceThreshold; + return deserializedIdentifyFromLargePersonGroupRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceRequest.java new file mode 100644 index 0000000000000..e84dd6a95d958 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceRequest.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UpdateFaceRequest model. + */ +@Fluent +public final class UpdateFaceRequest implements JsonSerializable { + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + private String userData; + + /** + * Creates an instance of UpdateFaceRequest class. + */ + @Generated + public UpdateFaceRequest() { + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @param userData the userData value to set. + * @return the UpdateFaceRequest object itself. + */ + @Generated + public UpdateFaceRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateFaceRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateFaceRequest 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 UpdateFaceRequest. + */ + @Generated + public static UpdateFaceRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateFaceRequest deserializedUpdateFaceRequest = new UpdateFaceRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("userData".equals(fieldName)) { + deserializedUpdateFaceRequest.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedUpdateFaceRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceRequest1.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceRequest1.java new file mode 100644 index 0000000000000..3a69f121392b4 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceRequest1.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UpdateFaceRequest1 model. + */ +@Fluent +public final class UpdateFaceRequest1 implements JsonSerializable { + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + private String userData; + + /** + * Creates an instance of UpdateFaceRequest1 class. + */ + @Generated + public UpdateFaceRequest1() { + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @param userData the userData value to set. + * @return the UpdateFaceRequest1 object itself. + */ + @Generated + public UpdateFaceRequest1 setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateFaceRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateFaceRequest1 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 UpdateFaceRequest1. + */ + @Generated + public static UpdateFaceRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateFaceRequest1 deserializedUpdateFaceRequest1 = new UpdateFaceRequest1(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("userData".equals(fieldName)) { + deserializedUpdateFaceRequest1.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedUpdateFaceRequest1; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonRequest.java new file mode 100644 index 0000000000000..9ee85dfa06cae --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UpdatePersonRequest model. + */ +@Fluent +public final class UpdatePersonRequest implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /** + * Creates an instance of UpdatePersonRequest class. + */ + @Generated + public UpdatePersonRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdatePersonRequest object itself. + */ + @Generated + public UpdatePersonRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdatePersonRequest object itself. + */ + @Generated + public UpdatePersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdatePersonRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdatePersonRequest 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 UpdatePersonRequest. + */ + @Generated + public static UpdatePersonRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdatePersonRequest deserializedUpdatePersonRequest = new UpdatePersonRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedUpdatePersonRequest.name = reader.getString(); + } else if ("userData".equals(fieldName)) { + deserializedUpdatePersonRequest.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedUpdatePersonRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateRequest.java new file mode 100644 index 0000000000000..d4b791dea8ec9 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UpdateRequest model. + */ +@Fluent +public final class UpdateRequest implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /** + * Creates an instance of UpdateRequest class. + */ + @Generated + public UpdateRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateRequest object itself. + */ + @Generated + public UpdateRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateRequest object itself. + */ + @Generated + public UpdateRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRequest 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 UpdateRequest. + */ + @Generated + public static UpdateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRequest deserializedUpdateRequest = new UpdateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedUpdateRequest.name = reader.getString(); + } else if ("userData".equals(fieldName)) { + deserializedUpdateRequest.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedUpdateRequest; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateRequest1.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateRequest1.java new file mode 100644 index 0000000000000..da501df886401 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateRequest1.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UpdateRequest1 model. + */ +@Fluent +public final class UpdateRequest1 implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /** + * Creates an instance of UpdateRequest1 class. + */ + @Generated + public UpdateRequest1() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateRequest1 object itself. + */ + @Generated + public UpdateRequest1 setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateRequest1 object itself. + */ + @Generated + public UpdateRequest1 setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRequest1 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 UpdateRequest1. + */ + @Generated + public static UpdateRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRequest1 deserializedUpdateRequest1 = new UpdateRequest1(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedUpdateRequest1.name = reader.getString(); + } else if ("userData".equals(fieldName)) { + deserializedUpdateRequest1.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedUpdateRequest1; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromLargePersonGroupRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromLargePersonGroupRequest.java new file mode 100644 index 0000000000000..c1036676dc3c7 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromLargePersonGroupRequest.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VerifyFromLargePersonGroupRequest model. + */ +@Immutable +public final class VerifyFromLargePersonGroupRequest implements JsonSerializable { + + /* + * The faceId of the face, come from "Detect". + */ + @Generated + private final String faceId; + + /* + * Using existing largePersonGroupId and personId for fast loading a specified person. largePersonGroupId is created + * in "Create Large Person Group". + */ + @Generated + private final String largePersonGroupId; + + /* + * Specify a certain person in Large Person Group. + */ + @Generated + private final String personId; + + /** + * Creates an instance of VerifyFromLargePersonGroupRequest class. + * + * @param faceId the faceId value to set. + * @param largePersonGroupId the largePersonGroupId value to set. + * @param personId the personId value to set. + */ + @Generated + public VerifyFromLargePersonGroupRequest(String faceId, String largePersonGroupId, String personId) { + this.faceId = faceId; + this.largePersonGroupId = largePersonGroupId; + this.personId = personId; + } + + /** + * Get the faceId property: The faceId of the face, come from "Detect". + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the largePersonGroupId property: Using existing largePersonGroupId and personId for fast loading a specified + * person. largePersonGroupId is created in "Create Large Person Group". + * + * @return the largePersonGroupId value. + */ + @Generated + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } + + /** + * Get the personId property: Specify a certain person in Large Person Group. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("faceId", this.faceId); + jsonWriter.writeStringField("largePersonGroupId", this.largePersonGroupId); + jsonWriter.writeStringField("personId", this.personId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VerifyFromLargePersonGroupRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VerifyFromLargePersonGroupRequest 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 VerifyFromLargePersonGroupRequest. + */ + @Generated + public static VerifyFromLargePersonGroupRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String faceId = null; + String largePersonGroupId = null; + String personId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("faceId".equals(fieldName)) { + faceId = reader.getString(); + } else if ("largePersonGroupId".equals(fieldName)) { + largePersonGroupId = reader.getString(); + } else if ("personId".equals(fieldName)) { + personId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new VerifyFromLargePersonGroupRequest(faceId, largePersonGroupId, personId); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AddFaceResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AddFaceResult.java new file mode 100644 index 0000000000000..bc387a2e9ed17 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AddFaceResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response body for adding face. + */ +@Immutable +public final class AddFaceResult implements JsonSerializable { + + /* + * Persisted Face ID of the added face, which is persisted and will not expire. Different from faceId which is + * created in "Detect" and will expire in 24 hours after the detection call. + */ + @Generated + private final String persistedFaceId; + + /** + * Creates an instance of AddFaceResult class. + * + * @param persistedFaceId the persistedFaceId value to set. + */ + @Generated + private AddFaceResult(String persistedFaceId) { + this.persistedFaceId = persistedFaceId; + } + + /** + * Get the persistedFaceId property: Persisted Face ID of the added face, which is persisted and will not expire. + * Different from faceId which is created in "Detect" and will expire in 24 hours after the detection call. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("persistedFaceId", this.persistedFaceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddFaceResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddFaceResult 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 AddFaceResult. + */ + @Generated + public static AddFaceResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String persistedFaceId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("persistedFaceId".equals(fieldName)) { + persistedFaceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new AddFaceResult(persistedFaceId); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionJsonContent.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java similarity index 79% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionJsonContent.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java index 5d89fa2a4529f..fcd6d226adca4 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionJsonContent.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java @@ -15,8 +15,8 @@ * Request for creating liveness with verify session. */ @Fluent -public final class CreateLivenessWithVerifySessionJsonContent - implements JsonSerializable { +public final class CreateLivenessWithVerifySessionContent + implements JsonSerializable { /* * Type of liveness mode the client should follow. @@ -79,12 +79,12 @@ public final class CreateLivenessWithVerifySessionJsonContent private Double verifyConfidenceThreshold; /** - * Creates an instance of CreateLivenessWithVerifySessionJsonContent class. + * Creates an instance of CreateLivenessWithVerifySessionContent class. * * @param livenessOperationMode the livenessOperationMode value to set. */ @Generated - public CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode livenessOperationMode) { + public CreateLivenessWithVerifySessionContent(LivenessOperationMode livenessOperationMode) { this.livenessOperationMode = livenessOperationMode; } @@ -118,10 +118,10 @@ public Boolean isSendResultsToClient() { * enabling business logic to be implemented. * * @param sendResultsToClient the sendResultsToClient value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent setSendResultsToClient(Boolean sendResultsToClient) { + public CreateLivenessWithVerifySessionContent setSendResultsToClient(Boolean sendResultsToClient) { this.sendResultsToClient = sendResultsToClient; return this; } @@ -144,10 +144,10 @@ public Boolean isDeviceCorrelationIdSetInClient() { * body. * * @param deviceCorrelationIdSetInClient the deviceCorrelationIdSetInClient value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent + public CreateLivenessWithVerifySessionContent setDeviceCorrelationIdSetInClient(Boolean deviceCorrelationIdSetInClient) { this.deviceCorrelationIdSetInClient = deviceCorrelationIdSetInClient; return this; @@ -167,10 +167,10 @@ public Boolean isEnableSessionImage() { * Set the enableSessionImage property: Whether or not store the session image. * * @param enableSessionImage the enableSessionImage value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent setEnableSessionImage(Boolean enableSessionImage) { + public CreateLivenessWithVerifySessionContent setEnableSessionImage(Boolean enableSessionImage) { this.enableSessionImage = enableSessionImage; return this; } @@ -191,11 +191,10 @@ public LivenessModel getLivenessSingleModalModel() { * 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 CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent - setLivenessSingleModalModel(LivenessModel livenessSingleModalModel) { + public CreateLivenessWithVerifySessionContent setLivenessSingleModalModel(LivenessModel livenessSingleModalModel) { this.livenessSingleModalModel = livenessSingleModalModel; return this; } @@ -218,10 +217,10 @@ public String getDeviceCorrelationId() { * null. * * @param deviceCorrelationId the deviceCorrelationId value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent setDeviceCorrelationId(String deviceCorrelationId) { + public CreateLivenessWithVerifySessionContent setDeviceCorrelationId(String deviceCorrelationId) { this.deviceCorrelationId = deviceCorrelationId; return this; } @@ -242,10 +241,10 @@ public Integer getAuthTokenTimeToLiveInSeconds() { * Default value is 600. * * @param authTokenTimeToLiveInSeconds the authTokenTimeToLiveInSeconds value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent + public CreateLivenessWithVerifySessionContent setAuthTokenTimeToLiveInSeconds(Integer authTokenTimeToLiveInSeconds) { this.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; return this; @@ -265,10 +264,10 @@ public Boolean isReturnVerifyImageHash() { * Set the returnVerifyImageHash property: Whether or not return the verify image hash. * * @param returnVerifyImageHash the returnVerifyImageHash value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent setReturnVerifyImageHash(Boolean returnVerifyImageHash) { + public CreateLivenessWithVerifySessionContent setReturnVerifyImageHash(Boolean returnVerifyImageHash) { this.returnVerifyImageHash = returnVerifyImageHash; return this; } @@ -287,10 +286,10 @@ public Double getVerifyConfidenceThreshold() { * Set the verifyConfidenceThreshold property: Threshold for confidence of the face verification. * * @param verifyConfidenceThreshold the verifyConfidenceThreshold value to set. - * @return the CreateLivenessWithVerifySessionJsonContent object itself. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionJsonContent setVerifyConfidenceThreshold(Double verifyConfidenceThreshold) { + public CreateLivenessWithVerifySessionContent setVerifyConfidenceThreshold(Double verifyConfidenceThreshold) { this.verifyConfidenceThreshold = verifyConfidenceThreshold; return this; } @@ -317,16 +316,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of CreateLivenessWithVerifySessionJsonContent from the JsonReader. + * Reads an instance of CreateLivenessWithVerifySessionContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of CreateLivenessWithVerifySessionJsonContent if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. + * @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 CreateLivenessWithVerifySessionJsonContent. + * @throws IOException If an error occurs while reading the CreateLivenessWithVerifySessionContent. */ @Generated - public static CreateLivenessWithVerifySessionJsonContent fromJson(JsonReader jsonReader) throws IOException { + public static CreateLivenessWithVerifySessionContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { LivenessOperationMode livenessOperationMode = null; Boolean sendResultsToClient = null; @@ -362,20 +361,19 @@ public static CreateLivenessWithVerifySessionJsonContent fromJson(JsonReader jso reader.skipChildren(); } } - CreateLivenessWithVerifySessionJsonContent deserializedCreateLivenessWithVerifySessionJsonContent - = new CreateLivenessWithVerifySessionJsonContent(livenessOperationMode); - deserializedCreateLivenessWithVerifySessionJsonContent.sendResultsToClient = sendResultsToClient; - deserializedCreateLivenessWithVerifySessionJsonContent.deviceCorrelationIdSetInClient + CreateLivenessWithVerifySessionContent deserializedCreateLivenessWithVerifySessionContent + = new CreateLivenessWithVerifySessionContent(livenessOperationMode); + deserializedCreateLivenessWithVerifySessionContent.sendResultsToClient = sendResultsToClient; + deserializedCreateLivenessWithVerifySessionContent.deviceCorrelationIdSetInClient = deviceCorrelationIdSetInClient; - deserializedCreateLivenessWithVerifySessionJsonContent.enableSessionImage = enableSessionImage; - deserializedCreateLivenessWithVerifySessionJsonContent.livenessSingleModalModel = livenessSingleModalModel; - deserializedCreateLivenessWithVerifySessionJsonContent.deviceCorrelationId = deviceCorrelationId; - deserializedCreateLivenessWithVerifySessionJsonContent.authTokenTimeToLiveInSeconds + deserializedCreateLivenessWithVerifySessionContent.enableSessionImage = enableSessionImage; + deserializedCreateLivenessWithVerifySessionContent.livenessSingleModalModel = livenessSingleModalModel; + deserializedCreateLivenessWithVerifySessionContent.deviceCorrelationId = deviceCorrelationId; + deserializedCreateLivenessWithVerifySessionContent.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; - deserializedCreateLivenessWithVerifySessionJsonContent.returnVerifyImageHash = returnVerifyImageHash; - deserializedCreateLivenessWithVerifySessionJsonContent.verifyConfidenceThreshold - = verifyConfidenceThreshold; - return deserializedCreateLivenessWithVerifySessionJsonContent; + deserializedCreateLivenessWithVerifySessionContent.returnVerifyImageHash = returnVerifyImageHash; + deserializedCreateLivenessWithVerifySessionContent.verifyConfidenceThreshold = verifyConfidenceThreshold; + return deserializedCreateLivenessWithVerifySessionContent; }); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreatePersonResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreatePersonResult.java new file mode 100644 index 0000000000000..d126f1a216227 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreatePersonResult.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; + +/** + * Response of create person. + */ +@Immutable +public final class CreatePersonResult implements JsonSerializable { + + /* + * Person ID of the person. + */ + @Generated + private final String personId; + + /** + * Creates an instance of CreatePersonResult class. + * + * @param personId the personId value to set. + */ + @Generated + private CreatePersonResult(String personId) { + this.personId = personId; + } + + /** + * Get the personId property: Person ID of the person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("personId", this.personId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreatePersonResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreatePersonResult 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 CreatePersonResult. + */ + @Generated + public static CreatePersonResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String personId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("personId".equals(fieldName)) { + personId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new CreatePersonResult(personId); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectFromSessionImageOptions.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectFromSessionImageOptions.java new file mode 100644 index 0000000000000..768d04ee2698b --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectFromSessionImageOptions.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.util.List; + +/** + * Options for detectFromSessionImage API. + */ +@Fluent +public final class DetectFromSessionImageOptions { + + /* + * 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. + */ + @Generated + private FaceDetectionModel detectionModel; + + /* + * 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'. + */ + @Generated + private FaceRecognitionModel recognitionModel; + + /* + * Return faceIds of the detected faces or not. The default value is true. + */ + @Generated + private Boolean returnFaceId; + + /* + * 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. + */ + @Generated + private List returnFaceAttributes; + + /* + * Return face landmarks of the detected faces or not. The default value is false. + */ + @Generated + private Boolean returnFaceLandmarks; + + /* + * Return 'recognitionModel' or not. The default value is false. This is only applicable when returnFaceId = true. + */ + @Generated + private Boolean returnRecognitionModel; + + /* + * 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). + */ + @Generated + private Integer faceIdTimeToLive; + + /* + * Id of session image. + */ + @Generated + private final String sessionImageId; + + /** + * Creates an instance of DetectFromSessionImageOptions class. + * + * @param sessionImageId the sessionImageId value to set. + */ + @Generated + public DetectFromSessionImageOptions(String sessionImageId) { + this.sessionImageId = sessionImageId; + } + + /** + * 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 + * 'detection_01'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 pixels) and + * rotated face orientations. + * + * @return the detectionModel value. + */ + @Generated + public FaceDetectionModel getDetectionModel() { + return this.detectionModel; + } + + /** + * Set 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 + * 'detection_01'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 pixels) and + * rotated face orientations. + * + * @param detectionModel the detectionModel value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setDetectionModel(FaceDetectionModel detectionModel) { + this.detectionModel = detectionModel; + return this; + } + + /** + * Get the recognitionModel property: 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'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: 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 recognitionModel the recognitionModel value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } + + /** + * Get the returnFaceId property: Return faceIds of the detected faces or not. The default value is true. + * + * @return the returnFaceId value. + */ + @Generated + public Boolean isReturnFaceId() { + return this.returnFaceId; + } + + /** + * Set the returnFaceId property: Return faceIds of the detected faces or not. The default value is true. + * + * @param returnFaceId the returnFaceId value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setReturnFaceId(Boolean returnFaceId) { + this.returnFaceId = returnFaceId; + return this; + } + + /** + * Get the returnFaceAttributes property: 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. + * + * @return the returnFaceAttributes value. + */ + @Generated + public List getReturnFaceAttributes() { + return this.returnFaceAttributes; + } + + /** + * Set the returnFaceAttributes property: 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 returnFaceAttributes the returnFaceAttributes value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setReturnFaceAttributes(List returnFaceAttributes) { + this.returnFaceAttributes = returnFaceAttributes; + return this; + } + + /** + * Get the returnFaceLandmarks property: Return face landmarks of the detected faces or not. The default value is + * false. + * + * @return the returnFaceLandmarks value. + */ + @Generated + public Boolean isReturnFaceLandmarks() { + return this.returnFaceLandmarks; + } + + /** + * Set the returnFaceLandmarks property: Return face landmarks of the detected faces or not. The default value is + * false. + * + * @param returnFaceLandmarks the returnFaceLandmarks value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setReturnFaceLandmarks(Boolean returnFaceLandmarks) { + this.returnFaceLandmarks = returnFaceLandmarks; + return this; + } + + /** + * Get the returnRecognitionModel property: Return 'recognitionModel' or not. The default value is false. This is + * only applicable when returnFaceId = true. + * + * @return the returnRecognitionModel value. + */ + @Generated + public Boolean isReturnRecognitionModel() { + return this.returnRecognitionModel; + } + + /** + * Set the returnRecognitionModel property: Return 'recognitionModel' or not. The default value is false. This is + * only applicable when returnFaceId = true. + * + * @param returnRecognitionModel the returnRecognitionModel value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setReturnRecognitionModel(Boolean returnRecognitionModel) { + this.returnRecognitionModel = returnRecognitionModel; + return this; + } + + /** + * Get the faceIdTimeToLive property: 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). + * + * @return the faceIdTimeToLive value. + */ + @Generated + public Integer getFaceIdTimeToLive() { + return this.faceIdTimeToLive; + } + + /** + * Set the faceIdTimeToLive property: 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). + * + * @param faceIdTimeToLive the faceIdTimeToLive value to set. + * @return the DetectFromSessionImageOptions object itself. + */ + @Generated + public DetectFromSessionImageOptions setFaceIdTimeToLive(Integer faceIdTimeToLive) { + this.faceIdTimeToLive = faceIdTimeToLive; + return this; + } + + /** + * Get the sessionImageId property: Id of session image. + * + * @return the sessionImageId value. + */ + @Generated + public String getSessionImageId() { + return this.sessionImageId; + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationCandidate.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationCandidate.java new file mode 100644 index 0000000000000..801428c22ffa5 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationCandidate.java @@ -0,0 +1,105 @@ +// 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; + +/** + * Candidate for identify call. + */ +@Immutable +public final class FaceIdentificationCandidate implements JsonSerializable { + + /* + * personId of candidate person. + */ + @Generated + private final String personId; + + /* + * Confidence value of the candidate. The higher confidence, the more similar. Range between [0,1]. + */ + @Generated + private final double confidence; + + /** + * Creates an instance of FaceIdentificationCandidate class. + * + * @param personId the personId value to set. + * @param confidence the confidence value to set. + */ + @Generated + private FaceIdentificationCandidate(String personId, double confidence) { + this.personId = personId; + this.confidence = confidence; + } + + /** + * Get the personId property: personId of candidate person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the confidence property: Confidence value of the candidate. The higher confidence, the more similar. Range + * between [0,1]. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("personId", this.personId); + jsonWriter.writeDoubleField("confidence", this.confidence); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FaceIdentificationCandidate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FaceIdentificationCandidate 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 FaceIdentificationCandidate. + */ + @Generated + public static FaceIdentificationCandidate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String personId = null; + double confidence = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("personId".equals(fieldName)) { + personId = reader.getString(); + } else if ("confidence".equals(fieldName)) { + confidence = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new FaceIdentificationCandidate(personId, confidence); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationResult.java new file mode 100644 index 0000000000000..5d5aad7c6b031 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationResult.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; + +/** + * Identify result. + */ +@Immutable +public final class FaceIdentificationResult implements JsonSerializable { + + /* + * faceId of the query face. + */ + @Generated + private final String faceId; + + /* + * Identified person candidates for that face (ranked by confidence). Array size should be no larger than input + * maxNumOfCandidatesReturned. If no person is identified, will return an empty array. + */ + @Generated + private final List candidates; + + /** + * Creates an instance of FaceIdentificationResult class. + * + * @param faceId the faceId value to set. + * @param candidates the candidates value to set. + */ + @Generated + private FaceIdentificationResult(String faceId, List candidates) { + this.faceId = faceId; + this.candidates = candidates; + } + + /** + * Get the faceId property: faceId of the query face. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the candidates property: Identified person candidates for that face (ranked by confidence). Array size should + * be no larger than input maxNumOfCandidatesReturned. If no person is identified, will return an empty array. + * + * @return the candidates value. + */ + @Generated + public List getCandidates() { + return this.candidates; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("faceId", this.faceId); + jsonWriter.writeArrayField("candidates", this.candidates, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FaceIdentificationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FaceIdentificationResult 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 FaceIdentificationResult. + */ + @Generated + public static FaceIdentificationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String faceId = null; + List candidates = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("faceId".equals(fieldName)) { + faceId = reader.getString(); + } else if ("candidates".equals(fieldName)) { + candidates = reader.readArray(reader1 -> FaceIdentificationCandidate.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new FaceIdentificationResult(faceId, candidates); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationStatus.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationStatus.java new file mode 100644 index 0000000000000..bfc20c28975ca --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationStatus.java @@ -0,0 +1,69 @@ +// 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 status of long running operation. + */ +public final class FaceOperationStatus extends ExpandableStringEnum { + + /** + * The operation is not started. + */ + @Generated + public static final FaceOperationStatus NOT_STARTED = fromString("notStarted"); + + /** + * The operation is still running. + */ + @Generated + public static final FaceOperationStatus RUNNING = fromString("running"); + + /** + * The operation is succeeded. + */ + @Generated + public static final FaceOperationStatus SUCCEEDED = fromString("succeeded"); + + /** + * The operation is failed. + */ + @Generated + public static final FaceOperationStatus FAILED = fromString("failed"); + + /** + * Creates a new instance of FaceOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceOperationStatus() { + } + + /** + * Creates or finds a FaceOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceOperationStatus. + */ + @Generated + public static FaceOperationStatus fromString(String name) { + return fromString(name, FaceOperationStatus.class); + } + + /** + * Gets known FaceOperationStatus values. + * + * @return known FaceOperationStatus values. + */ + @Generated + public static Collection values() { + return values(FaceOperationStatus.class); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceTrainingResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceTrainingResult.java new file mode 100644 index 0000000000000..468a80faffabc --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceTrainingResult.java @@ -0,0 +1,192 @@ +// 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; + +/** + * Training result of a container. + */ +@Immutable +public final class FaceTrainingResult implements JsonSerializable { + + /* + * Training status of the container. + */ + @Generated + private final FaceOperationStatus status; + + /* + * A combined UTC date and time string that describes the created time of the person group, large person group or + * large face list. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * A combined UTC date and time string that describes the last modify time of the person group, large person group + * or large face list, could be null value when the group is not successfully trained. + */ + @Generated + private final OffsetDateTime lastActionDateTime; + + /* + * A combined UTC date and time string that describes the last successful training time of the person group, large + * person group or large face list. + */ + @Generated + private final OffsetDateTime lastSuccessfulTrainingDateTime; + + /* + * Show failure message when training failed (omitted when training succeed). + */ + @Generated + private String message; + + /** + * Creates an instance of FaceTrainingResult class. + * + * @param status the status value to set. + * @param createdDateTime the createdDateTime value to set. + * @param lastActionDateTime the lastActionDateTime value to set. + * @param lastSuccessfulTrainingDateTime the lastSuccessfulTrainingDateTime value to set. + */ + @Generated + private FaceTrainingResult(FaceOperationStatus status, OffsetDateTime createdDateTime, + OffsetDateTime lastActionDateTime, OffsetDateTime lastSuccessfulTrainingDateTime) { + this.status = status; + this.createdDateTime = createdDateTime; + this.lastActionDateTime = lastActionDateTime; + this.lastSuccessfulTrainingDateTime = lastSuccessfulTrainingDateTime; + } + + /** + * Get the status property: Training status of the container. + * + * @return the status value. + */ + @Generated + public FaceOperationStatus getStatus() { + return this.status; + } + + /** + * Get the createdDateTime property: A combined UTC date and time string that describes the created time of the + * person group, large person group or large face list. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastActionDateTime property: A combined UTC date and time string that describes the last modify time of + * the person group, large person group or large face list, could be null value when the group is not successfully + * trained. + * + * @return the lastActionDateTime value. + */ + @Generated + public OffsetDateTime getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the lastSuccessfulTrainingDateTime property: A combined UTC date and time string that describes the last + * successful training time of the person group, large person group or large face list. + * + * @return the lastSuccessfulTrainingDateTime value. + */ + @Generated + public OffsetDateTime getLastSuccessfulTrainingDateTime() { + return this.lastSuccessfulTrainingDateTime; + } + + /** + * Get the message property: Show failure message when training failed (omitted when training succeed). + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastActionDateTime", + this.lastActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActionDateTime)); + jsonWriter.writeStringField("lastSuccessfulTrainingDateTime", + this.lastSuccessfulTrainingDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSuccessfulTrainingDateTime)); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FaceTrainingResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FaceTrainingResult 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 FaceTrainingResult. + */ + @Generated + public static FaceTrainingResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FaceOperationStatus status = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastActionDateTime = null; + OffsetDateTime lastSuccessfulTrainingDateTime = null; + String message = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("status".equals(fieldName)) { + status = FaceOperationStatus.fromString(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastActionDateTime".equals(fieldName)) { + lastActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSuccessfulTrainingDateTime".equals(fieldName)) { + lastSuccessfulTrainingDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else { + reader.skipChildren(); + } + } + FaceTrainingResult deserializedFaceTrainingResult + = new FaceTrainingResult(status, createdDateTime, lastActionDateTime, lastSuccessfulTrainingDateTime); + deserializedFaceTrainingResult.message = message; + return deserializedFaceTrainingResult; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceList.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceList.java new file mode 100644 index 0000000000000..4d8fca22233ac --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceList.java @@ -0,0 +1,149 @@ +// 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; + +/** + * Large face list is a list of faces, up to 1,000,000 faces. + */ +@Immutable +public final class LargeFaceList implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with + * detected faceIds. + */ + @Generated + private FaceRecognitionModel recognitionModel; + + /* + * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + */ + @Generated + private String largeFaceListId; + + /** + * Creates an instance of LargeFaceList class. + * + * @param name the name value to set. + */ + @Generated + private LargeFaceList(String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the largeFaceListId property: Valid character is letter in lower case or digit or '-' or '_', maximum length + * is 64. + * + * @return the largeFaceListId value. + */ + @Generated + public String getLargeFaceListId() { + return this.largeFaceListId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeStringField("recognitionModel", + this.recognitionModel == null ? null : this.recognitionModel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LargeFaceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LargeFaceList 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 LargeFaceList. + */ + @Generated + public static LargeFaceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String largeFaceListId = null; + String userData = null; + FaceRecognitionModel recognitionModel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("largeFaceListId".equals(fieldName)) { + largeFaceListId = reader.getString(); + } else if ("userData".equals(fieldName)) { + userData = reader.getString(); + } else if ("recognitionModel".equals(fieldName)) { + recognitionModel = FaceRecognitionModel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + LargeFaceList deserializedLargeFaceList = new LargeFaceList(name); + deserializedLargeFaceList.largeFaceListId = largeFaceListId; + deserializedLargeFaceList.userData = userData; + deserializedLargeFaceList.recognitionModel = recognitionModel; + return deserializedLargeFaceList; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceListFace.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceListFace.java new file mode 100644 index 0000000000000..246c4152718d7 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceListFace.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Face resource for large face list. + */ +@Immutable +public final class LargeFaceListFace implements JsonSerializable { + + /* + * Face ID of the face. + */ + @Generated + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + private String userData; + + /** + * Creates an instance of LargeFaceListFace class. + */ + @Generated + private LargeFaceListFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LargeFaceListFace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LargeFaceListFace 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 LargeFaceListFace. + */ + @Generated + public static LargeFaceListFace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LargeFaceListFace deserializedLargeFaceListFace = new LargeFaceListFace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("persistedFaceId".equals(fieldName)) { + deserializedLargeFaceListFace.persistedFaceId = reader.getString(); + } else if ("userData".equals(fieldName)) { + deserializedLargeFaceListFace.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedLargeFaceListFace; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroup.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroup.java new file mode 100644 index 0000000000000..2cef2be27d4e9 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroup.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 container of the uploaded person data, including face recognition feature, and up to 1,000,000 people. + */ +@Immutable +public final class LargePersonGroup implements JsonSerializable { + + /* + * User defined name, maximum length is 128. + */ + @Generated + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with + * detected faceIds. + */ + @Generated + private FaceRecognitionModel recognitionModel; + + /* + * ID of the container. + */ + @Generated + private String largePersonGroupId; + + /** + * Creates an instance of LargePersonGroup class. + * + * @param name the name value to set. + */ + @Generated + private LargePersonGroup(String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the largePersonGroupId property: ID of the container. + * + * @return the largePersonGroupId value. + */ + @Generated + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeStringField("recognitionModel", + this.recognitionModel == null ? null : this.recognitionModel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LargePersonGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LargePersonGroup 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 LargePersonGroup. + */ + @Generated + public static LargePersonGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String largePersonGroupId = null; + String userData = null; + FaceRecognitionModel recognitionModel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("largePersonGroupId".equals(fieldName)) { + largePersonGroupId = reader.getString(); + } else if ("userData".equals(fieldName)) { + userData = reader.getString(); + } else if ("recognitionModel".equals(fieldName)) { + recognitionModel = FaceRecognitionModel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + LargePersonGroup deserializedLargePersonGroup = new LargePersonGroup(name); + deserializedLargePersonGroup.largePersonGroupId = largePersonGroupId; + deserializedLargePersonGroup.userData = userData; + deserializedLargePersonGroup.recognitionModel = recognitionModel; + return deserializedLargePersonGroup; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPerson.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPerson.java new file mode 100644 index 0000000000000..1440c324816bc --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPerson.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; +import java.util.List; + +/** + * The person in a specified large person group. To add face to this person, please call "Add Large Person Group Person + * Face". + */ +@Immutable +public final class LargePersonGroupPerson implements JsonSerializable { + + /* + * ID of the person. + */ + @Generated + private String personId; + + /* + * User defined name, maximum length is 128. + */ + @Generated + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + private String userData; + + /* + * Face ids of registered faces in the person. + */ + @Generated + private List persistedFaceIds; + + /** + * Creates an instance of LargePersonGroupPerson class. + * + * @param name the name value to set. + */ + @Generated + private LargePersonGroupPerson(String name) { + this.name = name; + } + + /** + * Get the personId property: ID of the person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the persistedFaceIds property: Face ids of registered faces in the person. + * + * @return the persistedFaceIds value. + */ + @Generated + public List getPersistedFaceIds() { + return this.persistedFaceIds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeArrayField("persistedFaceIds", this.persistedFaceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LargePersonGroupPerson from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LargePersonGroupPerson 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 LargePersonGroupPerson. + */ + @Generated + public static LargePersonGroupPerson fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String personId = null; + String name = null; + String userData = null; + List persistedFaceIds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("personId".equals(fieldName)) { + personId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("userData".equals(fieldName)) { + userData = reader.getString(); + } else if ("persistedFaceIds".equals(fieldName)) { + persistedFaceIds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + LargePersonGroupPerson deserializedLargePersonGroupPerson = new LargePersonGroupPerson(name); + deserializedLargePersonGroupPerson.personId = personId; + deserializedLargePersonGroupPerson.userData = userData; + deserializedLargePersonGroupPerson.persistedFaceIds = persistedFaceIds; + return deserializedLargePersonGroupPerson; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPersonFace.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPersonFace.java new file mode 100644 index 0000000000000..a913318e4580f --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPersonFace.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Face resource for large person group person. + */ +@Immutable +public final class LargePersonGroupPersonFace implements JsonSerializable { + + /* + * Face ID of the face. + */ + @Generated + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + private String userData; + + /** + * Creates an instance of LargePersonGroupPersonFace class. + */ + @Generated + private LargePersonGroupPersonFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userData", this.userData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LargePersonGroupPersonFace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LargePersonGroupPersonFace 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 LargePersonGroupPersonFace. + */ + @Generated + public static LargePersonGroupPersonFace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LargePersonGroupPersonFace deserializedLargePersonGroupPersonFace = new LargePersonGroupPersonFace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("persistedFaceId".equals(fieldName)) { + deserializedLargePersonGroupPersonFace.persistedFaceId = reader.getString(); + } else if ("userData".equals(fieldName)) { + deserializedLargePersonGroupPersonFace.userData = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedLargePersonGroupPersonFace; + }); + } +} 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 afec059cfbcba..21ed9ca1932dc 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 @@ -1,28 +1,41 @@ { "flavor": "azure", "CrossLanguageDefinitionId": { + "com.azure.ai.vision.face.FaceAdministrationClientBuilder": "ClientCustomizations.FaceAdministrationClient", "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", @@ -35,6 +48,8 @@ "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", @@ -47,6 +62,8 @@ "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", "com.azure.ai.vision.face.FaceSessionClient.createLivenessSession": "ClientCustomizations.FaceSessionClient.createLivenessSession", "com.azure.ai.vision.face.FaceSessionClient.createLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessSession", @@ -58,6 +75,8 @@ "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", @@ -70,24 +89,167 @@ "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.LargeFaceListAsyncClient": "null", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.addFaceFromUrlImpl": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.addFaceFromUrlImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.addFaceImpl": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.addFaceImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.beginTrain": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.train", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.beginTrainWithModel": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.train", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.create": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.create", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.createWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.create", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.delete": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.deleteFace": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.deleteFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.deleteWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.get": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.get", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getFace": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getFaces": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getFacesWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getLargeFaceLists": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getLargeFaceListsWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getTrainingStatus": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.getWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.get", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.update": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.update", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.updateFace": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.updateFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace", + "com.azure.ai.vision.face.LargeFaceListAsyncClient.updateWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.update", + "com.azure.ai.vision.face.LargeFaceListClient": "null", + "com.azure.ai.vision.face.LargeFaceListClient.addFaceFromUrlImpl": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl", + "com.azure.ai.vision.face.LargeFaceListClient.addFaceFromUrlImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl", + "com.azure.ai.vision.face.LargeFaceListClient.addFaceImpl": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace", + "com.azure.ai.vision.face.LargeFaceListClient.addFaceImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace", + "com.azure.ai.vision.face.LargeFaceListClient.beginTrain": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.train", + "com.azure.ai.vision.face.LargeFaceListClient.beginTrainWithModel": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.train", + "com.azure.ai.vision.face.LargeFaceListClient.create": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.create", + "com.azure.ai.vision.face.LargeFaceListClient.createWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.create", + "com.azure.ai.vision.face.LargeFaceListClient.delete": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete", + "com.azure.ai.vision.face.LargeFaceListClient.deleteFace": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace", + "com.azure.ai.vision.face.LargeFaceListClient.deleteFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace", + "com.azure.ai.vision.face.LargeFaceListClient.deleteWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete", + "com.azure.ai.vision.face.LargeFaceListClient.get": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.get", + "com.azure.ai.vision.face.LargeFaceListClient.getFace": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace", + "com.azure.ai.vision.face.LargeFaceListClient.getFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace", + "com.azure.ai.vision.face.LargeFaceListClient.getFaces": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces", + "com.azure.ai.vision.face.LargeFaceListClient.getFacesWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces", + "com.azure.ai.vision.face.LargeFaceListClient.getLargeFaceLists": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists", + "com.azure.ai.vision.face.LargeFaceListClient.getLargeFaceListsWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists", + "com.azure.ai.vision.face.LargeFaceListClient.getTrainingStatus": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus", + "com.azure.ai.vision.face.LargeFaceListClient.getTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus", + "com.azure.ai.vision.face.LargeFaceListClient.getWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.get", + "com.azure.ai.vision.face.LargeFaceListClient.update": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.update", + "com.azure.ai.vision.face.LargeFaceListClient.updateFace": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace", + "com.azure.ai.vision.face.LargeFaceListClient.updateFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace", + "com.azure.ai.vision.face.LargeFaceListClient.updateWithResponse": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.update", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient": "null", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.addFaceFromUrlImpl": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.addFaceFromUrlImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.addFaceImpl": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.addFaceImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.beginTrain": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.beginTrainWithModel": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.create": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.createPerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.createPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.createWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.delete": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.deleteFace": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.deleteFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.deletePerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.deletePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.deleteWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.get": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getFace": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getLargePersonGroups": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getLargePersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getPerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getPersons": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getTrainingStatus": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.getWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.update": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.updateFace": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.updateFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.updatePerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.updatePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson", + "com.azure.ai.vision.face.LargePersonGroupAsyncClient.updateWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update", + "com.azure.ai.vision.face.LargePersonGroupClient": "null", + "com.azure.ai.vision.face.LargePersonGroupClient.addFaceFromUrlImpl": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl", + "com.azure.ai.vision.face.LargePersonGroupClient.addFaceFromUrlImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl", + "com.azure.ai.vision.face.LargePersonGroupClient.addFaceImpl": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace", + "com.azure.ai.vision.face.LargePersonGroupClient.addFaceImplWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace", + "com.azure.ai.vision.face.LargePersonGroupClient.beginTrain": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train", + "com.azure.ai.vision.face.LargePersonGroupClient.beginTrainWithModel": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train", + "com.azure.ai.vision.face.LargePersonGroupClient.create": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create", + "com.azure.ai.vision.face.LargePersonGroupClient.createPerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson", + "com.azure.ai.vision.face.LargePersonGroupClient.createPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson", + "com.azure.ai.vision.face.LargePersonGroupClient.createWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create", + "com.azure.ai.vision.face.LargePersonGroupClient.delete": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete", + "com.azure.ai.vision.face.LargePersonGroupClient.deleteFace": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace", + "com.azure.ai.vision.face.LargePersonGroupClient.deleteFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace", + "com.azure.ai.vision.face.LargePersonGroupClient.deletePerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson", + "com.azure.ai.vision.face.LargePersonGroupClient.deletePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson", + "com.azure.ai.vision.face.LargePersonGroupClient.deleteWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete", + "com.azure.ai.vision.face.LargePersonGroupClient.get": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get", + "com.azure.ai.vision.face.LargePersonGroupClient.getFace": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace", + "com.azure.ai.vision.face.LargePersonGroupClient.getFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace", + "com.azure.ai.vision.face.LargePersonGroupClient.getLargePersonGroups": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups", + "com.azure.ai.vision.face.LargePersonGroupClient.getLargePersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups", + "com.azure.ai.vision.face.LargePersonGroupClient.getPerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson", + "com.azure.ai.vision.face.LargePersonGroupClient.getPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson", + "com.azure.ai.vision.face.LargePersonGroupClient.getPersons": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons", + "com.azure.ai.vision.face.LargePersonGroupClient.getPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons", + "com.azure.ai.vision.face.LargePersonGroupClient.getTrainingStatus": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus", + "com.azure.ai.vision.face.LargePersonGroupClient.getTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus", + "com.azure.ai.vision.face.LargePersonGroupClient.getWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get", + "com.azure.ai.vision.face.LargePersonGroupClient.update": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update", + "com.azure.ai.vision.face.LargePersonGroupClient.updateFace": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace", + "com.azure.ai.vision.face.LargePersonGroupClient.updateFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace", + "com.azure.ai.vision.face.LargePersonGroupClient.updatePerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson", + "com.azure.ai.vision.face.LargePersonGroupClient.updatePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson", + "com.azure.ai.vision.face.LargePersonGroupClient.updateWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update", + "com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest": "addFaceFromUrl.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1": "addFaceFromUrl.Request.anonymous", "com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionMultipartContent": "Face.CreateLivenessWithVerifySessionMultipartContent", + "com.azure.ai.vision.face.implementation.models.CreatePersonRequest": "createPerson.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.CreateRequest": "create.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.CreateRequest1": "create.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.DetectFromSessionImageRequest": "detectFromSessionImage.Request.anonymous", "com.azure.ai.vision.face.implementation.models.DetectFromUrlImplOptions": "null", "com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest": "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": "updateFace.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.UpdateFaceRequest1": "updateFace.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.UpdatePersonRequest": "updatePerson.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.UpdateRequest": "update.Request.anonymous", + "com.azure.ai.vision.face.implementation.models.UpdateRequest1": "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.CreateLivenessWithVerifySessionJsonContent": "Face.CreateLivenessWithVerifySessionJsonContent", + "com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent": "Face.CreateLivenessWithVerifySessionJsonContent", "com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult": "Face.CreateLivenessWithVerifySessionResult", + "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", @@ -96,12 +258,16 @@ "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.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", "com.azure.ai.vision.face.models.FindSimilarMatchMode": "Face.FindSimilarMatchMode", @@ -111,6 +277,11 @@ "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.LivenessModel": "Face.LivenessModel", "com.azure.ai.vision.face.models.LivenessOperationMode": "Face.LivenessOperationMode", "com.azure.ai.vision.face.models.LivenessOutputsTarget": "Face.LivenessOutputsTarget", 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 b60b0d75592b3..d7b936a16956c 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 @@ -6,7 +6,7 @@ import com.azure.ai.vision.face.models.CreateLivenessSessionContent; import com.azure.ai.vision.face.models.CreateLivenessSessionResult; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionJsonContent; +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; @@ -125,7 +125,7 @@ public void createLivenessWithVerifySessionAndGetResult() { .buildClient(); String deviceCorrelationId = UUID.randomUUID().toString(); - CreateLivenessWithVerifySessionJsonContent parameters = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) + CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationId(deviceCorrelationId) .setSendResultsToClient(false); Path path = Paths.get(imagePathString); 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 ca9ae3f5d71de..449d8d11b7a43 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 @@ -5,7 +5,7 @@ import com.azure.ai.vision.face.FaceSessionClient; import com.azure.ai.vision.face.FaceSessionClientBuilder; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionJsonContent; +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; @@ -41,7 +41,7 @@ public static void main(String[] args) { .credential(new AzureKeyCredential(ConfigurationHelper.getAccountKey())) .buildClient(); - CreateLivenessWithVerifySessionJsonContent parameters = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) + CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationId(UUID.randomUUID().toString()) .setSendResultsToClient(false) .setAuthTokenTimeToLiveInSeconds(60); 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 0d6f76c7c2035..76dc5d0c3e3aa 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 @@ -5,7 +5,7 @@ import com.azure.ai.vision.face.FaceSessionAsyncClient; import com.azure.ai.vision.face.FaceSessionClientBuilder; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionJsonContent; +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; @@ -41,7 +41,7 @@ public static void main(String[] args) { .credential(new AzureKeyCredential(ConfigurationHelper.getAccountKey())) .buildAsyncClient(); - CreateLivenessWithVerifySessionJsonContent parameters = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) + CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationId(UUID.randomUUID().toString()) .setSendResultsToClient(false) .setAuthTokenTimeToLiveInSeconds(60); diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/generated/FaceAdministrationClientTestBase.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/generated/FaceAdministrationClientTestBase.java new file mode 100644 index 0000000000000..fad1851e2c3fd --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/generated/FaceAdministrationClientTestBase.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.ai.vision.face.FaceAdministrationClientBuilder; +import com.azure.ai.vision.face.FaceClient; +import com.azure.ai.vision.face.FaceClientBuilder; +import com.azure.ai.vision.face.FaceSessionClient; +import com.azure.ai.vision.face.FaceSessionClientBuilder; +import com.azure.ai.vision.face.LargeFaceListClient; +import com.azure.ai.vision.face.LargePersonGroupClient; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +class FaceAdministrationClientTestBase extends TestProxyTestBase { + protected LargeFaceListClient largeFaceListClient; + + protected LargePersonGroupClient largePersonGroupClient; + + protected FaceClient faceClient; + + protected FaceSessionClient faceSessionClient; + + @Override + protected void beforeTest() { + FaceAdministrationClientBuilder largeFaceListClientbuilder = new FaceAdministrationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + largeFaceListClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + largeFaceListClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + largeFaceListClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + largeFaceListClient = largeFaceListClientbuilder.buildLargeFaceListClient(); + + FaceAdministrationClientBuilder largePersonGroupClientbuilder = new FaceAdministrationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + largePersonGroupClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + largePersonGroupClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + largePersonGroupClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + largePersonGroupClient = largePersonGroupClientbuilder.buildLargePersonGroupClient(); + + FaceClientBuilder faceClientbuilder + = new FaceClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceClientbuilder.httpClient(interceptorManager.getPlaybackClient()).credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + faceClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + faceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + faceClient = faceClientbuilder.buildClient(); + + FaceSessionClientBuilder faceSessionClientbuilder = new FaceSessionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceSessionClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + faceSessionClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + faceSessionClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + faceSessionClient = faceSessionClientbuilder.buildClient(); + + } +} diff --git a/sdk/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 9bc971ed6e126..51be94910eec5 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 @@ -6,7 +6,7 @@ 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.CreateLivenessWithVerifySessionJsonContent; +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; @@ -46,7 +46,7 @@ public void testCreateSession( String httpClientName, FaceServiceVersion serviceVersion, Supplier commandProvider, String path) { String uuid = UUID.randomUUID().toString(); - CreateLivenessWithVerifySessionJsonContent content = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) + CreateLivenessWithVerifySessionContent content = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationId(uuid); createSessionAndVerify(commandProvider.get(), content, path); } @@ -55,7 +55,7 @@ public void testCreateSession( @MethodSource("getDataForTestSessionCreation") public void testCreateSessionDeviceIdOptional( String httpClientName, FaceServiceVersion serviceVersion, Supplier commandProvider, String path) { - CreateLivenessWithVerifySessionJsonContent content = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) + CreateLivenessWithVerifySessionContent content = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationIdSetInClient(true); createSessionAndVerify(commandProvider.get(), content, path); } @@ -69,7 +69,7 @@ public void testCreateSessionWithTokenTTL(String httpClientName, FaceServiceVers int authTokenTimeToLiveInSeconds = 60; String uuid = UUID.randomUUID().toString(); - CreateLivenessWithVerifySessionJsonContent content = new CreateLivenessWithVerifySessionJsonContent(LivenessOperationMode.PASSIVE) + CreateLivenessWithVerifySessionContent content = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) .setDeviceCorrelationId(uuid) .setAuthTokenTimeToLiveInSeconds(authTokenTimeToLiveInSeconds); @@ -104,7 +104,7 @@ private Stream getDataForTestSessionCreation() { } private CreateLivenessWithVerifySessionResult createSessionAndVerify( - ILivenessWithVerifySessionSyncCommands livenessCommands, CreateLivenessWithVerifySessionJsonContent content, String path) { + ILivenessWithVerifySessionSyncCommands livenessCommands, CreateLivenessWithVerifySessionContent content, String path) { BinaryData imageData = path != null ? Utils.loadFromFile(path) : null; CreateLivenessWithVerifySessionResult result = livenessCommands.createLivenessWithVerifySessionSync(content, imageData); 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 ea2fe5675e7ec..3be51203631f3 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 @@ -3,14 +3,14 @@ package com.azure.ai.vision.face.tests.commands.liveness; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionJsonContent; +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( - CreateLivenessWithVerifySessionJsonContent content, BinaryData verifyImage); + CreateLivenessWithVerifySessionContent content, BinaryData verifyImage); LivenessWithVerifySession getLivenessWithVerifySessionResultSync(String sessionId); void deleteLivenessWithVerifySessionSync(String sessionId); } 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 0dda8723ee548..14bde4250ad11 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 @@ -4,7 +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.CreateLivenessWithVerifySessionJsonContent; +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; @@ -19,7 +19,7 @@ class LivenessWithVerifySessionAsyncCommands implements ILivenessWithVerifySessi } public Mono createLivenessWithVerifySession( - CreateLivenessWithVerifySessionJsonContent content, BinaryData verifyImage) { + CreateLivenessWithVerifySessionContent content, BinaryData verifyImage) { return mAsyncClient.createLivenessWithVerifySession(content, verifyImage); } @@ -34,7 +34,7 @@ public Mono deleteLivenessWithVerifySession(String sessionId) { @Override public CreateLivenessWithVerifySessionResult createLivenessWithVerifySessionSync( - CreateLivenessWithVerifySessionJsonContent content, BinaryData verifyImage) { + CreateLivenessWithVerifySessionContent content, BinaryData verifyImage) { return FunctionUtils.callAndAwait(() -> createLivenessWithVerifySession(content, verifyImage)); } 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 dba56600b8687..cea6abbe21556 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 @@ -4,7 +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.CreateLivenessWithVerifySessionJsonContent; +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; @@ -17,7 +17,7 @@ class LivenessWithVerifySessionSyncCommands implements ILivenessWithVerifySessio } public CreateLivenessWithVerifySessionResult createLivenessWithVerifySessionSync( - CreateLivenessWithVerifySessionJsonContent content, BinaryData verifyImage) { + CreateLivenessWithVerifySessionContent content, BinaryData verifyImage) { return mSyncClient.createLivenessWithVerifySession(content, verifyImage); } diff --git a/sdk/face/azure-ai-vision-face/tsp-location.yaml b/sdk/face/azure-ai-vision-face/tsp-location.yaml index 94c146ea9eb30..e6c0164ad50be 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: 891bd1284700b9e8e8dfdfab2fbc8a7feaa77003 +commit: b3d5c34b3447f71ca8474aa9d32449aafe3996a2 repo: Azure/azure-rest-api-specs additionalDirectories: null