Skip to content

Commit

Permalink
[Automation] Generate SDK based on TypeSpec 0.20.1 (Azure#41675)
Browse files Browse the repository at this point in the history
* [Automation] Generate SDK based on TypeSpec 0.20.1

* remove DetectFromUrlRequest

---------

Co-authored-by: Weidong Xu <weidxu@microsoft.com>
  • Loading branch information
azure-sdk and weidongxu-microsoft authored Aug 29, 2024
1 parent c433997 commit 261f322
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 56 deletions.
8 changes: 4 additions & 4 deletions eng/emitter-package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion eng/emitter-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main": "dist/src/index.js",
"dependencies": {
"@azure-tools/typespec-java": "0.20.0"
"@azure-tools/typespec-java": "0.20.1"
},
"devDependencies": {
"@azure-tools/typespec-autorest": "0.45.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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.DetectFromUrlImplRequest;
import com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest;
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.VerifyFaceToFaceRequest;
Expand Down Expand Up @@ -72,7 +72,7 @@ public final class FaceAsyncClient {
* The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
* target faceId array.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* faceId: String (Required)
Expand All @@ -83,9 +83,9 @@ public final class FaceAsyncClient {
* ]
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* [
* (Required){
Expand Down Expand Up @@ -122,16 +122,16 @@ public Mono<Response<BinaryData>> findSimilarWithResponse(BinaryData findSimilar
* &gt; * For the scenarios that are sensitive to accuracy please make your own judgment.
* &gt; * The 'recognitionModel' associated with the both faces should be the same.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* faceId1: String (Required)
* faceId2: String (Required)
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* {
* isIdentical: boolean (Required)
Expand Down Expand Up @@ -168,17 +168,17 @@ public Mono<Response<BinaryData>> verifyFaceToFaceWithResponse(BinaryData verify
* only have 2 candidate faces.
* * The 'recognitionModel' associated with the query faces' faceIds should be the same.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* faceIds (Required): [
* String (Required)
* ]
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* {
* groups (Required): [
Expand Down Expand Up @@ -422,15 +422,15 @@ public Mono<FaceGroupingResult> group(List<String> faceIds) {
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* url: String (Required)
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* [
* (Required){
Expand Down Expand Up @@ -608,13 +608,13 @@ Mono<Response<BinaryData>> detectFromUrlImplWithResponse(BinaryData detectFromUr
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* BinaryData
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* [
* (Required){
Expand Down Expand Up @@ -786,7 +786,7 @@ Mono<List<FaceDetectionResult>> detectFromUrlImpl(DetectFromUrlImplOptions optio
Boolean returnFaceLandmarks = options.isReturnFaceLandmarks();
Boolean returnRecognitionModel = options.isReturnRecognitionModel();
Integer faceIdTimeToLive = options.getFaceIdTimeToLive();
DetectFromUrlImplRequest detectFromUrlRequestObj = new DetectFromUrlImplRequest(options.getUrl());
DetectFromUrlRequest detectFromUrlRequestObj = new DetectFromUrlRequest(options.getUrl());
BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj);
if (detectionModel != null) {
requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false);
Expand Down Expand Up @@ -1322,7 +1322,7 @@ public Mono<List<FaceDetectionResult>> detect(String url, FaceDetectionModel det
addRequiredQueryParameterForDetection(requestOptions, detectionModel, recognitionModel, returnFaceId);
addOptionalQueryParameterForDetection(requestOptions, returnFaceAttributes, returnFaceLandmarks,
returnRecognitionModel, faceIdTimeToLive);
DetectFromUrlImplRequest requestObj = new DetectFromUrlImplRequest(url);
DetectFromUrlRequest requestObj = new DetectFromUrlRequest(url);
BinaryData request = BinaryData.fromObject(requestObj);
return detectFromUrlImplWithResponse(request, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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.DetectFromUrlImplRequest;
import com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest;
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.VerifyFaceToFaceRequest;
Expand Down Expand Up @@ -70,7 +70,7 @@ public final class FaceClient {
* The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the
* target faceId array.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* faceId: String (Required)
Expand All @@ -81,9 +81,9 @@ public final class FaceClient {
* ]
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* [
* (Required){
Expand Down Expand Up @@ -119,16 +119,16 @@ public Response<BinaryData> findSimilarWithResponse(BinaryData findSimilarReques
* &gt; * For the scenarios that are sensitive to accuracy please make your own judgment.
* &gt; * The 'recognitionModel' associated with the both faces should be the same.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* faceId1: String (Required)
* faceId2: String (Required)
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* {
* isIdentical: boolean (Required)
Expand Down Expand Up @@ -165,17 +165,17 @@ public Response<BinaryData> verifyFaceToFaceWithResponse(BinaryData verifyFaceTo
* only have 2 candidate faces.
* * The 'recognitionModel' associated with the query faces' faceIds should be the same.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* faceIds (Required): [
* String (Required)
* ]
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* {
* groups (Required): [
Expand Down Expand Up @@ -417,15 +417,15 @@ public FaceGroupingResult group(List<String> faceIds) {
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* {
* url: String (Required)
* }
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* [
* (Required){
Expand Down Expand Up @@ -602,13 +602,13 @@ Response<BinaryData> detectFromUrlImplWithResponse(BinaryData detectFromUrlReque
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>{@code
* BinaryData
* }</pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>{@code
* [
* (Required){
Expand Down Expand Up @@ -780,7 +780,7 @@ List<FaceDetectionResult> detectFromUrlImpl(DetectFromUrlImplOptions options) {
Boolean returnFaceLandmarks = options.isReturnFaceLandmarks();
Boolean returnRecognitionModel = options.isReturnRecognitionModel();
Integer faceIdTimeToLive = options.getFaceIdTimeToLive();
DetectFromUrlImplRequest detectFromUrlRequestObj = new DetectFromUrlImplRequest(options.getUrl());
DetectFromUrlRequest detectFromUrlRequestObj = new DetectFromUrlRequest(options.getUrl());
BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj);
if (detectionModel != null) {
requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false);
Expand Down Expand Up @@ -1316,7 +1316,7 @@ public List<FaceDetectionResult> detect(String url, FaceDetectionModel detection
addRequiredQueryParameterForDetection(requestOptions, detectionModel, recognitionModel, returnFaceId);
addOptionalQueryParameterForDetection(requestOptions, returnFaceAttributes, returnFaceLandmarks,
returnRecognitionModel, faceIdTimeToLive);
DetectFromUrlImplRequest requestObj = new DetectFromUrlImplRequest(url);
DetectFromUrlRequest requestObj = new DetectFromUrlRequest(url);
BinaryData request = BinaryData.fromObject(requestObj);
return detectFromUrlImplWithResponse(request, requestOptions).getValue()
.toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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;
Expand All @@ -12,30 +13,29 @@
import java.io.IOException;

/**
* The DetectFromUrlImplRequest model.
* The DetectFromUrlRequest model.
*/
@Immutable
public final class DetectFromUrlImplRequest implements JsonSerializable<DetectFromUrlImplRequest> {

public final class DetectFromUrlRequest implements JsonSerializable<DetectFromUrlRequest> {
/*
* URL of input image.
*/
@Generated
private final String url;

/**
* Creates an instance of DetectFromUrlImplRequest class.
*
* Creates an instance of DetectFromUrlRequest class.
*
* @param url the url value to set.
*/
@Generated
public DetectFromUrlImplRequest(String url) {
public DetectFromUrlRequest(String url) {
this.url = url;
}

/**
* Get the url property: URL of input image.
*
*
* @return the url value.
*/
@Generated
Expand All @@ -55,28 +55,29 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
}

/**
* Reads an instance of DetectFromUrlImplRequest from the JsonReader.
*
* Reads an instance of DetectFromUrlRequest from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DetectFromUrlImplRequest if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @return An instance of DetectFromUrlRequest 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 DetectFromUrlImplRequest.
* @throws IOException If an error occurs while reading the DetectFromUrlRequest.
*/
@Generated
public static DetectFromUrlImplRequest fromJson(JsonReader jsonReader) throws IOException {
public static DetectFromUrlRequest 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 DetectFromUrlImplRequest(url);
return new DetectFromUrlRequest(url);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"com.azure.ai.vision.face.FaceSessionClientBuilder": "ClientCustomizations.FaceSessionClient",
"com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionMultipartContent": "Face.CreateLivenessWithVerifySessionMultipartContent",
"com.azure.ai.vision.face.implementation.models.DetectFromUrlImplOptions": "null",
"com.azure.ai.vision.face.implementation.models.DetectFromUrlImplRequest": "detectFromUrl.Request.anonymous",
"com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest": "detectFromUrl.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.VerifyFaceToFaceRequest": "ClientCustomizations.verifyFaceToFace.Request.anonymous",
Expand Down

0 comments on commit 261f322

Please sign in to comment.