Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-ai-translation-document] Addressing SDK archboard review comments #13017

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ public final class SingleDocumentTranslationAsyncClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<BinaryData>> documentTranslateWithResponse(String targetLanguage, BinaryData documentTranslateContent,
Mono<Response<BinaryData>> translateWithResponse(String targetLanguage, BinaryData documentTranslateContent,
RequestOptions requestOptions) {
// Protocol API requires serialization of parts with content-disposition and data, as operation
// 'documentTranslate' is 'multipart/form-data'
return this.serviceClient.documentTranslateWithResponseAsync(targetLanguage, documentTranslateContent,
requestOptions);
// Protocol API requires serialization of parts with content-disposition and data, as operation 'translate' is
// 'multipart/form-data'
return this.serviceClient.translateWithResponseAsync(targetLanguage, documentTranslateContent, requestOptions);
}

/**
Expand Down Expand Up @@ -119,9 +118,9 @@ Mono<Response<BinaryData>> documentTranslateWithResponse(String targetLanguage,
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<BinaryData> documentTranslate(String targetLanguage, DocumentTranslateContent documentTranslateContent,
public Mono<BinaryData> translate(String targetLanguage, DocumentTranslateContent documentTranslateContent,
String sourceLanguage, String category, Boolean allowFallback) {
// Generated convenience method for documentTranslateWithResponse
// Generated convenience method for translateWithResponse
RequestOptions requestOptions = new RequestOptions();
if (sourceLanguage != null) {
requestOptions.addQueryParam("sourceLanguage", sourceLanguage, false);
Expand All @@ -132,7 +131,7 @@ public Mono<BinaryData> documentTranslate(String targetLanguage, DocumentTransla
if (allowFallback != null) {
requestOptions.addQueryParam("allowFallback", String.valueOf(allowFallback), false);
}
return documentTranslateWithResponse(targetLanguage,
return translateWithResponse(targetLanguage,
new MultipartFormDataHelper(requestOptions)
.serializeFileField("document", documentTranslateContent.getDocument().getContent(),
documentTranslateContent.getDocument().getContentType(),
Expand Down Expand Up @@ -180,11 +179,10 @@ public Mono<BinaryData> documentTranslate(String targetLanguage, DocumentTransla
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<BinaryData> documentTranslate(String targetLanguage,
DocumentTranslateContent documentTranslateContent) {
// Generated convenience method for documentTranslateWithResponse
public Mono<BinaryData> translate(String targetLanguage, DocumentTranslateContent documentTranslateContent) {
// Generated convenience method for translateWithResponse
RequestOptions requestOptions = new RequestOptions();
return documentTranslateWithResponse(targetLanguage,
return translateWithResponse(targetLanguage,
new MultipartFormDataHelper(requestOptions)
.serializeFileField("document", documentTranslateContent.getDocument().getContent(),
documentTranslateContent.getDocument().getContentType(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ public final class SingleDocumentTranslationClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BinaryData> documentTranslateWithResponse(String targetLanguage, BinaryData documentTranslateContent,
Response<BinaryData> translateWithResponse(String targetLanguage, BinaryData documentTranslateContent,
RequestOptions requestOptions) {
// Protocol API requires serialization of parts with content-disposition and data, as operation
// 'documentTranslate' is 'multipart/form-data'
return this.serviceClient.documentTranslateWithResponse(targetLanguage, documentTranslateContent,
requestOptions);
// Protocol API requires serialization of parts with content-disposition and data, as operation 'translate' is
// 'multipart/form-data'
return this.serviceClient.translateWithResponse(targetLanguage, documentTranslateContent, requestOptions);
}

/**
Expand Down Expand Up @@ -117,9 +116,9 @@ Response<BinaryData> documentTranslateWithResponse(String targetLanguage, Binary
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public BinaryData documentTranslate(String targetLanguage, DocumentTranslateContent documentTranslateContent,
public BinaryData translate(String targetLanguage, DocumentTranslateContent documentTranslateContent,
String sourceLanguage, String category, Boolean allowFallback) {
// Generated convenience method for documentTranslateWithResponse
// Generated convenience method for translateWithResponse
RequestOptions requestOptions = new RequestOptions();
if (sourceLanguage != null) {
requestOptions.addQueryParam("sourceLanguage", sourceLanguage, false);
Expand All @@ -130,7 +129,7 @@ public BinaryData documentTranslate(String targetLanguage, DocumentTranslateCont
if (allowFallback != null) {
requestOptions.addQueryParam("allowFallback", String.valueOf(allowFallback), false);
}
return documentTranslateWithResponse(targetLanguage,
return translateWithResponse(targetLanguage,
new MultipartFormDataHelper(requestOptions)
.serializeFileField("document", documentTranslateContent.getDocument().getContent(),
documentTranslateContent.getDocument().getContentType(),
Expand Down Expand Up @@ -178,10 +177,10 @@ public BinaryData documentTranslate(String targetLanguage, DocumentTranslateCont
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public BinaryData documentTranslate(String targetLanguage, DocumentTranslateContent documentTranslateContent) {
// Generated convenience method for documentTranslateWithResponse
public BinaryData translate(String targetLanguage, DocumentTranslateContent documentTranslateContent) {
// Generated convenience method for translateWithResponse
RequestOptions requestOptions = new RequestOptions();
return documentTranslateWithResponse(targetLanguage,
return translateWithResponse(targetLanguage,
new MultipartFormDataHelper(requestOptions)
.serializeFileField("document", documentTranslateContent.getDocument().getContent(),
documentTranslateContent.getDocument().getContentType(),
Expand Down
Loading