From 83026f6172a728bc72159d62bfc1c8b65ccb65de Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 4 Jun 2024 01:51:05 -0400 Subject: [PATCH] [Automation] Generate SDK based on TypeSpec 0.16.3 (#40469) * [Automation] Generate SDK based on TypeSpec 0.16.3 * remove "endpoint" validation in openai * Delete sdk/informaticadatamanagement/azure-resourcemanager-informaticadatamanagement/src/test/java/com/azure/resourcemanager/informaticadatamanagement/generated/ServerlessRuntimesStartFailedServerlessRuntimeWithResponseMockTests.java --------- Co-authored-by: Weidong Xu --- eng/emitter-package-lock.json | 14 ++--- eng/emitter-package.json | 2 +- .../compute/batch/BatchClientBuilder.java | 8 +++ .../JobRouterAdministrationClientBuilder.java | 8 +++ .../jobrouter/JobRouterClientBuilder.java | 8 +++ .../contentsafety/BlocklistClientBuilder.java | 8 +++ .../ContentSafetyClientBuilder.java | 8 +++ ...telligenceAdministrationClientBuilder.java | 8 +++ .../DocumentIntelligenceClientBuilder.java | 8 +++ .../namespaces/EventGridClientBuilder.java | 8 +++ .../azure/ai/vision/face/FaceAsyncClient.java | 44 +++++++------- .../com/azure/ai/vision/face/FaceClient.java | 44 +++++++------- .../ai/vision/face/FaceClientBuilder.java | 8 +++ .../vision/face/FaceSessionClientBuilder.java | 8 +++ .../face/implementation/FaceClientImpl.java | 58 ++++++++++--------- .../RadiologyInsightsAsyncClient.java | 4 +- .../RadiologyInsightsClient.java | 4 +- .../RadiologyInsightsClientBuilder.java | 8 +++ .../RadiologyInsightsClientImpl.java | 14 ++--- .../assistants/AssistantsClientBuilder.java | 6 ++ .../azure/ai/openai/OpenAIClientBuilder.java | 6 ++ .../purview/datamap/DataMapClientBuilder.java | 8 +++ .../text/TextTranslationClientBuilder.java | 7 +++ 23 files changed, 212 insertions(+), 87 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index b387bcee76dcb..232131db3b64c 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.16.2" + "@azure-tools/typespec-java": "0.16.3" }, "devDependencies": { "@azure-tools/typespec-azure-core": "0.42.0", @@ -150,9 +150,9 @@ } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.16.2.tgz", - "integrity": "sha512-tPGCA1nY+3DRpyEmHQhhZSphzoerIJb/2WgiqrBh8eRDsVu9znEHg4037wOK/ePtpPBUCVXtJ27Kw13MG2NhMQ==", + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.16.3.tgz", + "integrity": "sha512-xfEelLz7VxgYf6xC5GL/9OZAd8w9BgJ1ILm2ZeLH2riAklJ+akEBUFokqJGBchpmGHbmNOeaJakXpgp+KblM1A==", "dependencies": { "@autorest/codemodel": "~4.20.0", "js-yaml": "~4.1.0", @@ -973,9 +973,9 @@ } }, "node_modules/yaml": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", - "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.3.tgz", + "integrity": "sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==", "bin": { "yaml": "bin.mjs" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 4c7c1e32290a2..4fbcbfb7ccae6 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.16.2" + "@azure-tools/typespec-java": "0.16.3" }, "devDependencies": { "@azure-tools/typespec-azure-core": "0.42.0", diff --git a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClientBuilder.java b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClientBuilder.java index 38674f1b7cb49..c4e2738f86479 100644 --- a/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClientBuilder.java +++ b/sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClientBuilder.java @@ -272,6 +272,7 @@ public BatchClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private BatchClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); BatchServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : BatchServiceVersion.getLatest(); @@ -342,4 +343,11 @@ public BatchClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(BatchClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java index 9dfb6e9abe66b..bfecfa3a9e2e0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java @@ -239,6 +239,7 @@ public JobRouterAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) */ @Generated private JobRouterAdministrationClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); JobRouterServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : JobRouterServiceVersion.getLatest(); @@ -368,4 +369,11 @@ private HttpPipelinePolicy createHttpPipelineAuthPolicy() { new IllegalStateException("Missing credential information while building a 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."); + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java index dbcfeb2613cc6..ec5a536ba1245 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java @@ -237,6 +237,7 @@ public JobRouterClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private JobRouterClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); JobRouterServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : JobRouterServiceVersion.getLatest(); @@ -366,4 +367,11 @@ private HttpPipelinePolicy createHttpPipelineAuthPolicy() { new IllegalStateException("Missing credential information while building a 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."); + } } diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java index afb632be880f4..573f25401cd96 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java @@ -274,6 +274,7 @@ public BlocklistClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private BlocklistClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); ContentSafetyServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ContentSafetyServiceVersion.getLatest(); @@ -344,4 +345,11 @@ public BlocklistClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(BlocklistClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java index 9855002142f7f..4660805b99a8b 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/ContentSafetyClientBuilder.java @@ -274,6 +274,7 @@ public ContentSafetyClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private ContentSafetyClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); ContentSafetyServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : ContentSafetyServiceVersion.getLatest(); @@ -344,4 +345,11 @@ public ContentSafetyClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(ContentSafetyClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java index 7de72754e1f79..3184abc1d2e9d 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java @@ -282,6 +282,7 @@ public DocumentIntelligenceAdministrationClientBuilder retryPolicy(RetryPolicy r */ @Generated private DocumentIntelligenceAdministrationClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); DocumentIntelligenceServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : DocumentIntelligenceServiceVersion.getLatest(); @@ -290,6 +291,13 @@ private DocumentIntelligenceAdministrationClientImpl buildInnerClient() { return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClientBuilder.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClientBuilder.java index af1dc2c202d26..ac864876c03a5 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClientBuilder.java +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceClientBuilder.java @@ -275,6 +275,7 @@ public DocumentIntelligenceClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private DocumentIntelligenceClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); DocumentIntelligenceServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : DocumentIntelligenceServiceVersion.getLatest(); @@ -283,6 +284,13 @@ private DocumentIntelligenceClientImpl buildInnerClient() { return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridClientBuilder.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridClientBuilder.java index 3519550a4c3f1..d5b4ef1f04cde 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridClientBuilder.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridClientBuilder.java @@ -275,6 +275,7 @@ public EventGridClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private EventGridClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); EventGridServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : EventGridServiceVersion.getLatest(); @@ -345,4 +346,11 @@ public EventGridClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(EventGridClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java index 1d350fbbce68e..893b5bbab0080 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 @@ -96,7 +96,7 @@ public final class FaceAsyncClient { * ] * } * - * @param request The request parameter. + * @param findSimilarRequest The findSimilarRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -106,8 +106,9 @@ public final class FaceAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> findSimilarWithResponse(BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.findSimilarWithResponseAsync(request, requestOptions); + public Mono> findSimilarWithResponse(BinaryData findSimilarRequest, + RequestOptions requestOptions) { + return this.serviceClient.findSimilarWithResponseAsync(findSimilarRequest, requestOptions); } /** @@ -138,7 +139,7 @@ public Mono> findSimilarWithResponse(BinaryData request, Re * } * } * - * @param request The request parameter. + * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -148,8 +149,9 @@ public Mono> findSimilarWithResponse(BinaryData request, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> verifyFaceToFaceWithResponse(BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.verifyFaceToFaceWithResponseAsync(request, requestOptions); + public Mono> verifyFaceToFaceWithResponse(BinaryData verifyFaceToFaceRequest, + RequestOptions requestOptions) { + return this.serviceClient.verifyFaceToFaceWithResponseAsync(verifyFaceToFaceRequest, requestOptions); } /** @@ -190,7 +192,7 @@ public Mono> verifyFaceToFaceWithResponse(BinaryData reques * } * } * - * @param request The request parameter. + * @param groupRequest The groupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -201,8 +203,8 @@ public Mono> verifyFaceToFaceWithResponse(BinaryData reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> groupWithResponse(BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.groupWithResponseAsync(request, requestOptions); + public Mono> groupWithResponse(BinaryData groupRequest, RequestOptions requestOptions) { + return this.serviceClient.groupWithResponseAsync(groupRequest, requestOptions); } /** @@ -241,11 +243,11 @@ public Mono> findSimilar(String faceId, List Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { // Generated convenience method for findSimilarWithResponse RequestOptions requestOptions = new RequestOptions(); - FindSimilarRequest requestObj + FindSimilarRequest findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) .setMode(mode); - BinaryData request = BinaryData.fromObject(requestObj); - return findSimilarWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); } @@ -281,9 +283,9 @@ public Mono> findSimilar(String faceId, List public Mono> findSimilar(String faceId, List faceIds) { // Generated convenience method for findSimilarWithResponse RequestOptions requestOptions = new RequestOptions(); - FindSimilarRequest requestObj = new FindSimilarRequest(faceId, faceIds); - BinaryData request = BinaryData.fromObject(requestObj); - return findSimilarWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + FindSimilarRequest findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds); + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); } @@ -313,9 +315,9 @@ public Mono> findSimilar(String faceId, List public Mono verifyFaceToFace(String faceId1, String faceId2) { // Generated convenience method for verifyFaceToFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - VerifyFaceToFaceRequest requestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); - BinaryData request = BinaryData.fromObject(requestObj); - return verifyFaceToFaceWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + VerifyFaceToFaceRequest verifyFaceToFaceRequestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); + BinaryData verifyFaceToFaceRequest = BinaryData.fromObject(verifyFaceToFaceRequestObj); + return verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); } @@ -347,9 +349,9 @@ public Mono verifyFaceToFace(String faceId1, String face public Mono group(List faceIds) { // Generated convenience method for groupWithResponse RequestOptions requestOptions = new RequestOptions(); - GroupRequest requestObj = new GroupRequest(faceIds); - BinaryData request = BinaryData.fromObject(requestObj); - return groupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + GroupRequest groupRequestObj = new GroupRequest(faceIds); + BinaryData groupRequest = BinaryData.fromObject(groupRequestObj); + return groupWithResponse(groupRequest, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(FaceGroupingResult.class)); } 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 d84a40e487835..b828bd100eb53 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 @@ -94,7 +94,7 @@ public final class FaceClient { * ] * } * - * @param request The request parameter. + * @param findSimilarRequest The findSimilarRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -104,8 +104,8 @@ public final class FaceClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response findSimilarWithResponse(BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.findSimilarWithResponse(request, requestOptions); + public Response findSimilarWithResponse(BinaryData findSimilarRequest, RequestOptions requestOptions) { + return this.serviceClient.findSimilarWithResponse(findSimilarRequest, requestOptions); } /** @@ -136,7 +136,7 @@ public Response findSimilarWithResponse(BinaryData request, RequestO * } * } * - * @param request The request parameter. + * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -146,8 +146,9 @@ public Response findSimilarWithResponse(BinaryData request, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response verifyFaceToFaceWithResponse(BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.verifyFaceToFaceWithResponse(request, requestOptions); + public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceToFaceRequest, + RequestOptions requestOptions) { + return this.serviceClient.verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions); } /** @@ -188,7 +189,7 @@ public Response verifyFaceToFaceWithResponse(BinaryData request, Req * } * } * - * @param request The request parameter. + * @param groupRequest The groupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -198,8 +199,8 @@ public Response verifyFaceToFaceWithResponse(BinaryData request, Req */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response groupWithResponse(BinaryData request, RequestOptions requestOptions) { - return this.serviceClient.groupWithResponse(request, requestOptions); + public Response groupWithResponse(BinaryData groupRequest, RequestOptions requestOptions) { + return this.serviceClient.groupWithResponse(groupRequest, requestOptions); } /** @@ -238,11 +239,11 @@ public List findSimilar(String faceId, List faceI Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { // Generated convenience method for findSimilarWithResponse RequestOptions requestOptions = new RequestOptions(); - FindSimilarRequest requestObj + FindSimilarRequest findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) .setMode(mode); - BinaryData request = BinaryData.fromObject(requestObj); - return findSimilarWithResponse(request, requestOptions).getValue() + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, requestOptions).getValue() .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); } @@ -278,9 +279,9 @@ public List findSimilar(String faceId, List faceI public List findSimilar(String faceId, List faceIds) { // Generated convenience method for findSimilarWithResponse RequestOptions requestOptions = new RequestOptions(); - FindSimilarRequest requestObj = new FindSimilarRequest(faceId, faceIds); - BinaryData request = BinaryData.fromObject(requestObj); - return findSimilarWithResponse(request, requestOptions).getValue() + FindSimilarRequest findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds); + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, requestOptions).getValue() .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); } @@ -310,9 +311,10 @@ public List findSimilar(String faceId, List faceI public FaceVerificationResult verifyFaceToFace(String faceId1, String faceId2) { // Generated convenience method for verifyFaceToFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - VerifyFaceToFaceRequest requestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); - BinaryData request = BinaryData.fromObject(requestObj); - return verifyFaceToFaceWithResponse(request, requestOptions).getValue().toObject(FaceVerificationResult.class); + VerifyFaceToFaceRequest verifyFaceToFaceRequestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); + BinaryData verifyFaceToFaceRequest = BinaryData.fromObject(verifyFaceToFaceRequestObj); + return verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions).getValue() + .toObject(FaceVerificationResult.class); } /** @@ -343,9 +345,9 @@ public FaceVerificationResult verifyFaceToFace(String faceId1, String faceId2) { public FaceGroupingResult group(List faceIds) { // Generated convenience method for groupWithResponse RequestOptions requestOptions = new RequestOptions(); - GroupRequest requestObj = new GroupRequest(faceIds); - BinaryData request = BinaryData.fromObject(requestObj); - return groupWithResponse(request, requestOptions).getValue().toObject(FaceGroupingResult.class); + GroupRequest groupRequestObj = new GroupRequest(faceIds); + BinaryData groupRequest = BinaryData.fromObject(groupRequestObj); + return groupWithResponse(groupRequest, requestOptions).getValue().toObject(FaceGroupingResult.class); } @Generated diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java index 8f9a4fa138c79..c7bdbd3068984 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java @@ -273,6 +273,7 @@ public FaceClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private FaceClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); FaceServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); @@ -343,4 +344,11 @@ public FaceClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(FaceClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java index 1b7c11e8fb755..7964961dc1e0d 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java @@ -274,6 +274,7 @@ public FaceSessionClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private FaceSessionClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); FaceServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); @@ -344,4 +345,11 @@ public FaceSessionClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(FaceSessionClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java index 275cef3463a24..9623162244d1f 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 @@ -200,7 +200,8 @@ Response detectImplSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> findSimilar(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData findSimilarRequest, RequestOptions requestOptions, + Context context); @Post("/findsimilars") @ExpectedResponses({ 200 }) @@ -210,7 +211,8 @@ Mono> findSimilar(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response findSimilarSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData findSimilarRequest, RequestOptions requestOptions, + Context context); @Post("/verify") @ExpectedResponses({ 200 }) @@ -220,7 +222,8 @@ Response findSimilarSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> verifyFaceToFace(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions, + Context context); @Post("/verify") @ExpectedResponses({ 200 }) @@ -230,7 +233,8 @@ Mono> verifyFaceToFace(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Response verifyFaceToFaceSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions, + Context context); @Post("/group") @ExpectedResponses({ 200 }) @@ -240,7 +244,7 @@ Response verifyFaceToFaceSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> group(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData groupRequest, RequestOptions requestOptions, Context context); @Post("/group") @ExpectedResponses({ 200 }) @@ -250,7 +254,7 @@ Mono> group(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response groupSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + @BodyParam("application/json") BinaryData groupRequest, RequestOptions requestOptions, Context context); } /** @@ -1030,7 +1034,7 @@ public Response detectImplWithResponse(BinaryData imageContent, Requ * ] * } * - * @param request The request parameter. + * @param findSimilarRequest The findSimilarRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1039,10 +1043,11 @@ public Response detectImplWithResponse(BinaryData imageContent, Requ * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> findSimilarWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + public Mono> findSimilarWithResponseAsync(BinaryData findSimilarRequest, + RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.findSimilar(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, findSimilarRequest, requestOptions, context)); } /** @@ -1084,7 +1089,7 @@ public Mono> findSimilarWithResponseAsync(BinaryData reques * ] * } * - * @param request The request parameter. + * @param findSimilarRequest The findSimilarRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1093,10 +1098,10 @@ public Mono> findSimilarWithResponseAsync(BinaryData reques * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response findSimilarWithResponse(BinaryData request, RequestOptions requestOptions) { + public Response findSimilarWithResponse(BinaryData findSimilarRequest, RequestOptions requestOptions) { final String accept = "application/json"; - return service.findSimilarSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, - requestOptions, Context.NONE); + return service.findSimilarSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + findSimilarRequest, requestOptions, Context.NONE); } /** @@ -1127,7 +1132,7 @@ public Response findSimilarWithResponse(BinaryData request, RequestO * } * } * - * @param request The request parameter. + * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1136,11 +1141,11 @@ public Response findSimilarWithResponse(BinaryData request, RequestO * @return verify result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> verifyFaceToFaceWithResponseAsync(BinaryData request, + public Mono> verifyFaceToFaceWithResponseAsync(BinaryData verifyFaceToFaceRequest, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.verifyFaceToFace(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + this.getServiceVersion().getVersion(), accept, verifyFaceToFaceRequest, requestOptions, context)); } /** @@ -1171,7 +1176,7 @@ public Mono> verifyFaceToFaceWithResponseAsync(BinaryData r * } * } * - * @param request The request parameter. + * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1180,10 +1185,11 @@ public Mono> verifyFaceToFaceWithResponseAsync(BinaryData r * @return verify result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response verifyFaceToFaceWithResponse(BinaryData request, RequestOptions requestOptions) { + public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceToFaceRequest, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.verifyFaceToFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, - requestOptions, Context.NONE); + return service.verifyFaceToFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + verifyFaceToFaceRequest, requestOptions, Context.NONE); } /** @@ -1224,7 +1230,7 @@ public Response verifyFaceToFaceWithResponse(BinaryData request, Req * } * } * - * @param request The request parameter. + * @param groupRequest The groupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1234,10 +1240,10 @@ public Response verifyFaceToFaceWithResponse(BinaryData request, Req * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> groupWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + public Mono> groupWithResponseAsync(BinaryData groupRequest, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.group(this.getEndpoint(), this.getServiceVersion().getVersion(), - accept, request, requestOptions, context)); + accept, groupRequest, requestOptions, context)); } /** @@ -1278,7 +1284,7 @@ public Mono> groupWithResponseAsync(BinaryData request, Req * } * } * - * @param request The request parameter. + * @param groupRequest The groupRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1287,9 +1293,9 @@ public Mono> groupWithResponseAsync(BinaryData request, Req * @return response body for group face operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response groupWithResponse(BinaryData request, RequestOptions requestOptions) { + public Response groupWithResponse(BinaryData groupRequest, RequestOptions requestOptions) { final String accept = "application/json"; - return service.groupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, + return service.groupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, groupRequest, requestOptions, Context.NONE); } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java index 1a2ed3274b024..bc4cd3dc1c76d 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsAsyncClient.java @@ -396,7 +396,7 @@ public final class RadiologyInsightsAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is 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 response for the Radiology Insights request. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) @@ -417,7 +417,7 @@ public PollerFlux beginInferRadiologyInsights(BinaryData * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the 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 response for the Radiology Insights request. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java index 3d1b73041df16..7de41efdfc193 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClient.java @@ -396,7 +396,7 @@ public final class RadiologyInsightsClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is 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 response for the Radiology Insights request. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) @@ -417,7 +417,7 @@ public SyncPoller beginInferRadiologyInsights(BinaryData * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the 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 response for the Radiology Insights request. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java index b0a3d0519895c..b507f4259589e 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/RadiologyInsightsClientBuilder.java @@ -253,6 +253,7 @@ public RadiologyInsightsClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private RadiologyInsightsClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); RadiologyInsightsServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : RadiologyInsightsServiceVersion.getLatest(); @@ -320,4 +321,11 @@ public RadiologyInsightsClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(RadiologyInsightsClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } } diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java index a707e266f6199..b1b46bfb3bdb2 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/src/main/java/com/azure/health/insights/radiologyinsights/implementation/RadiologyInsightsClientImpl.java @@ -544,8 +544,8 @@ Response inferRadiologyInsightsSync(@HostParam("endpoint") String en * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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 for the Radiology Insights request along with {@link Response} on successful completion of - * {@link Mono}. + * @return provides status details for long running operations along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> inferRadiologyInsightsWithResponseAsync(BinaryData radiologyInsightsData, @@ -928,7 +928,7 @@ private Mono> inferRadiologyInsightsWithResponseAsync(Binar * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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 for the Radiology Insights request along with {@link Response}. + * @return provides status details for long running operations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response inferRadiologyInsightsWithResponse(BinaryData radiologyInsightsData, @@ -1311,7 +1311,7 @@ private Response inferRadiologyInsightsWithResponse(BinaryData radio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is 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 response for the Radiology Insights request. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux beginInferRadiologyInsightsAsync(BinaryData radiologyInsightsData, @@ -1687,7 +1687,7 @@ public PollerFlux beginInferRadiologyInsightsAsync(Binar * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is 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 response for the Radiology Insights request. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginInferRadiologyInsights(BinaryData radiologyInsightsData, @@ -2063,7 +2063,7 @@ public SyncPoller beginInferRadiologyInsights(BinaryData * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is 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 response for the Radiology Insights request. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux @@ -2440,7 +2440,7 @@ public SyncPoller beginInferRadiologyInsights(BinaryData * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is 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 response for the Radiology Insights request. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller diff --git a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClientBuilder.java b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClientBuilder.java index 85a0113e90b5d..b5e1d6f6d31c5 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClientBuilder.java +++ b/sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/AssistantsClientBuilder.java @@ -346,6 +346,7 @@ public AssistantsClientBuilder serviceVersion(AssistantsServiceVersion serviceVe * @return an instance of AssistantsClientImpl. */ private AssistantsClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); AssistantsServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : AssistantsServiceVersion.getLatest(); @@ -357,4 +358,9 @@ private AssistantsClientImpl buildInnerClient() { localServiceVersion); return client; } + + 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. + } } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java index 575a5cb09bc73..556fa5a977abb 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java @@ -276,6 +276,7 @@ public OpenAIClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private OpenAIClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); OpenAIServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : OpenAIServiceVersion.getLatest(); @@ -366,4 +367,9 @@ public OpenAIClient buildClient() { private boolean useNonAzureOpenAIService() { return endpoint == null || endpoint.startsWith(OPEN_AI_ENDPOINT); } + + 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. + } } diff --git a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/DataMapClientBuilder.java b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/DataMapClientBuilder.java index 8348312117bcd..c3d29aa9c8ac4 100644 --- a/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/DataMapClientBuilder.java +++ b/sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/DataMapClientBuilder.java @@ -269,6 +269,7 @@ public DataMapClientBuilder retryPolicy(RetryPolicy retryPolicy) { */ @Generated private DataMapClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); PurviewDataMapServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : PurviewDataMapServiceVersion.getLatest(); @@ -277,6 +278,13 @@ private DataMapClientImpl buildInnerClient() { return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration diff --git a/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/TextTranslationClientBuilder.java b/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/TextTranslationClientBuilder.java index d1173d9b62b08..49cdc935232e8 100644 --- a/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/TextTranslationClientBuilder.java +++ b/sdk/translation/azure-ai-translation-text/src/main/java/com/azure/ai/translation/text/TextTranslationClientBuilder.java @@ -442,4 +442,11 @@ public TextTranslationClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(TextTranslationClientBuilder.class); + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } }