diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationAsyncClient.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationAsyncClient.java
index 8c955a345b43c..277609db2da1b 100644
--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationAsyncClient.java
+++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationAsyncClient.java
@@ -4,11 +4,13 @@
package com.azure.ai.translation.document;
import com.azure.ai.translation.document.implementation.DocumentTranslationClientImpl;
+import com.azure.ai.translation.document.implementation.models.FileFormatType;
+import com.azure.ai.translation.document.implementation.models.SupportedFileFormats;
import com.azure.ai.translation.document.models.DocumentStatus;
import com.azure.ai.translation.document.models.FileFormatType;
-import com.azure.ai.translation.document.models.StartTranslationDetails;
import com.azure.ai.translation.document.models.SupportedFileFormats;
-import com.azure.ai.translation.document.models.TranslationStatus;
+import com.azure.ai.translation.document.models.TranslationBatch;
+import com.azure.ai.translation.document.models.TranslationStatusResult;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
@@ -51,6 +53,357 @@ public final class DocumentTranslationAsyncClient {
this.serviceClient = serviceClient;
}
+ /**
+ * Returns the status for a specific document
+ *
+ * Returns the translation status for a specific document based on the request Id
+ * and document Id.
+ *
Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * path: String (Optional)
+ * sourcePath: String (Required)
+ * createdDateTimeUtc: OffsetDateTime (Required)
+ * lastActionDateTimeUtc: OffsetDateTime (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
+ * to: String (Required)
+ * error (Optional): {
+ * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): (recursive schema, see innerError above)
+ * }
+ * }
+ * progress: double (Required)
+ * id: String (Required)
+ * characterCharged: Integer (Optional)
+ * }
+ * }
+ *
+ *
+ * @param translationId Format - uuid. The batch id.
+ * @param documentId Format - uuid. The document id.
+ * @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 document Status Response along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getDocumentStatusWithResponse(String translationId, String documentId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getDocumentStatusWithResponseAsync(translationId, documentId, requestOptions);
+ }
+
+ /**
+ * Returns the status for a document translation request
+ *
+ * Returns the status for a document translation request.
+ * The status includes the
+ * overall request status, as well as the status for documents that are being
+ * translated as part of that request.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * createdDateTimeUtc: OffsetDateTime (Required)
+ * lastActionDateTimeUtc: OffsetDateTime (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
+ * error (Optional): {
+ * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): (recursive schema, see innerError above)
+ * }
+ * }
+ * summary (Required): {
+ * total: int (Required)
+ * failed: int (Required)
+ * success: int (Required)
+ * inProgress: int (Required)
+ * notYetStarted: int (Required)
+ * cancelled: int (Required)
+ * totalCharacterCharged: long (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param translationId Format - uuid. The operation id.
+ * @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 translation job status response along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getTranslationStatusWithResponse(String translationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getTranslationStatusWithResponseAsync(translationId, requestOptions);
+ }
+
+ /**
+ * Cancel a currently processing or queued translation
+ *
+ * Cancel a currently processing or queued translation.
+ * A translation will not be
+ * cancelled if it is already completed or failed or cancelling. A bad request
+ * will be returned.
+ * All documents that have completed translation will not be
+ * cancelled and will be charged.
+ * All pending documents will be cancelled if
+ * possible.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * createdDateTimeUtc: OffsetDateTime (Required)
+ * lastActionDateTimeUtc: OffsetDateTime (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
+ * error (Optional): {
+ * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): (recursive schema, see innerError above)
+ * }
+ * }
+ * summary (Required): {
+ * total: int (Required)
+ * failed: int (Required)
+ * success: int (Required)
+ * inProgress: int (Required)
+ * notYetStarted: int (Required)
+ * cancelled: int (Required)
+ * totalCharacterCharged: long (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param translationId Format - uuid. The operation-id.
+ * @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 translation job status response along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> cancelTranslationWithResponse(String translationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.cancelTranslationWithResponseAsync(translationId, requestOptions);
+ }
+
+ /**
+ * Returns a list of supported document formats
+ *
+ * The list of supported formats supported by the Document Translation
+ * service.
+ * The list includes the common file extension, as well as the
+ * content-type if using the upload API.
+ * Query Parameters
+ *
+ * Query Parameters
+ * Name | Type | Required | Description |
+ * type | String | No | the type of format like document or glossary . Allowed values:
+ * "document", "glossary". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * value (Required): [
+ * (Required){
+ * format: String (Required)
+ * fileExtensions (Required): [
+ * String (Required)
+ * ]
+ * contentTypes (Required): [
+ * String (Required)
+ * ]
+ * defaultVersion: String (Optional)
+ * versions (Optional): [
+ * String (Optional)
+ * ]
+ * type: String(document/glossary) (Optional)
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return list of supported file formats along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono> getSupportedFormatsWithResponse(RequestOptions requestOptions) {
+ return this.serviceClient.getSupportedFormatsWithResponseAsync(requestOptions);
+ }
+
+ /**
+ * Returns the status for a specific document
+ *
+ * Returns the translation status for a specific document based on the request Id
+ * and document Id.
+ *
+ * @param translationId Format - uuid. The batch id.
+ * @param documentId Format - uuid. The document id.
+ * @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 document Status Response on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getDocumentStatus(String translationId, String documentId) {
+ // Generated convenience method for getDocumentStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getDocumentStatusWithResponse(translationId, documentId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(DocumentStatus.class));
+ }
+
+ /**
+ * Returns the status for a document translation request
+ *
+ * Returns the status for a document translation request.
+ * The status includes the
+ * overall request status, as well as the status for documents that are being
+ * translated as part of that request.
+ *
+ * @param translationId Format - uuid. The operation id.
+ * @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 translation job status response on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getTranslationStatus(String translationId) {
+ // Generated convenience method for getTranslationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTranslationStatusWithResponse(translationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatusResult.class));
+ }
+
+ /**
+ * Cancel a currently processing or queued translation
+ *
+ * Cancel a currently processing or queued translation.
+ * A translation will not be
+ * cancelled if it is already completed or failed or cancelling. A bad request
+ * will be returned.
+ * All documents that have completed translation will not be
+ * cancelled and will be charged.
+ * All pending documents will be cancelled if
+ * possible.
+ *
+ * @param translationId Format - uuid. The operation-id.
+ * @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 translation job status response on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono cancelTranslation(String translationId) {
+ // Generated convenience method for cancelTranslationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return cancelTranslationWithResponse(translationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatusResult.class));
+ }
+
+ /**
+ * Returns a list of supported document formats
+ *
+ * The list of supported formats supported by the Document Translation
+ * service.
+ * The list includes the common file extension, as well as the
+ * content-type if using the upload API.
+ *
+ * @param type the type of format like document or glossary.
+ * @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 list of supported file formats on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono getSupportedFormats(FileFormatType type) {
+ // Generated convenience method for getSupportedFormatsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (type != null) {
+ requestOptions.addQueryParam("type", type.toString(), false);
+ }
+ return getSupportedFormatsWithResponse(requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(SupportedFileFormats.class));
+ }
+
+ /**
+ * Returns a list of supported document formats
+ *
+ * The list of supported formats supported by the Document Translation
+ * service.
+ * The list includes the common file extension, as well as the
+ * content-type if using the upload API.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if 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 list of supported file formats on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono getSupportedFormats() {
+ // Generated convenience method for getSupportedFormatsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getSupportedFormatsWithResponse(requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(SupportedFileFormats.class));
+ }
+
/**
* Submit a document translation request to the Document Translation service
*
@@ -112,7 +465,7 @@ public final class DocumentTranslationAsyncClient {
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -122,9 +475,8 @@ public final class DocumentTranslationAsyncClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux beginStartTranslation(BinaryData startTranslationDetails,
- RequestOptions requestOptions) {
- return this.serviceClient.beginStartTranslationAsync(startTranslationDetails, requestOptions);
+ public PollerFlux beginBeginTranslation(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.beginBeginTranslationAsync(body, requestOptions);
}
/**
@@ -180,218 +532,57 @@ public PollerFlux beginStartTranslation(BinaryData start
* instead of just ignoring the query options.
* This reduces the risk of the client
* making assumptions about the data returned.
- * Query Parameters
- *
- * Query Parameters
- * Name | Type | Required | Description |
- * top | Integer | No | top indicates the total number of records the user wants to be
- * returned across
- * all pages.
- *
- * Clients MAY use top and skip query parameters to
- * specify a number of results to return and an offset into the collection.
- * When
- * both top and skip are given by a client, the server SHOULD first apply skip
- * and then top on the collection.
- *
- * Note: If the server can't honor
- * top and/or skip, the server MUST return an error to the client informing
- * about it instead of just ignoring the query options. |
- * skip | Integer | No | skip indicates the number of records to skip from the list of
- * records held by
- * the server based on the sorting method specified. By default, we sort by
- * descending start time.
- *
- * Clients MAY use top and skip query
- * parameters to specify a number of results to return and an offset into the
- * collection.
- * When both top and skip are given by a client, the server SHOULD
- * first apply skip and then top on the collection.
- *
- * Note: If the
- * server can't honor top and/or skip, the server MUST return an error to the
- * client informing about it instead of just ignoring the query options. |
- * maxpagesize | Integer | No | maxpagesize is the maximum items returned in a page. If
- * more items are
- * requested via top (or top is not specified and there are more items to be
- * returned), @nextLink will contain the link to the next page.
- *
- * Clients MAY request server-driven paging with a specific page size by
- * specifying a maxpagesize preference. The server SHOULD honor this preference
- * if the specified page size is smaller than the server's default page size. |
- * ids | List<String> | No | Ids to use in filtering. In the form of "," separated
- * string. |
- * statuses | List<String> | No | Statuses to use in filtering. In the form of ","
- * separated string. |
- * createdDateTimeUtcStart | OffsetDateTime | No | the start datetime to get items
- * after |
- * createdDateTimeUtcEnd | OffsetDateTime | No | the end datetime to get items
- * before |
- * orderby | List<String> | No | the sorting query for the collection (ex:
- * 'CreatedDateTimeUtc asc','CreatedDateTimeUtc desc'). In the form of "," separated string. |
- *
- * You can add these to a request with {@link RequestOptions#addQueryParam}
- * Response Body Schema
- *
- *
- * {@code
- * {
- * id: String (Required)
- * createdDateTimeUtc: OffsetDateTime (Required)
- * lastActionDateTimeUtc: OffsetDateTime (Required)
- * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
- * error (Optional): {
- * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): {
- * code: String (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): (recursive schema, see innerError above)
- * }
- * }
- * summary (Required): {
- * total: int (Required)
- * failed: int (Required)
- * success: int (Required)
- * inProgress: int (Required)
- * notYetStarted: int (Required)
- * cancelled: int (Required)
- * totalCharacterCharged: long (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 translation job Status Response as paginated response with {@link PagedFlux}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getTranslationsStatus(RequestOptions requestOptions) {
- return this.serviceClient.getTranslationsStatusAsync(requestOptions);
- }
-
- /**
- * Returns the status for a specific document
- *
- * Returns the translation status for a specific document based on the request Id
- * and document Id.
- * Response Body Schema
- *
- *
- * {@code
- * {
- * path: String (Optional)
- * sourcePath: String (Required)
- * createdDateTimeUtc: OffsetDateTime (Required)
- * lastActionDateTimeUtc: OffsetDateTime (Required)
- * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
- * to: String (Required)
- * error (Optional): {
- * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): {
- * code: String (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): (recursive schema, see innerError above)
- * }
- * }
- * progress: double (Required)
- * id: String (Required)
- * characterCharged: Integer (Optional)
- * }
- * }
- *
- *
- * @param id Format - uuid. The batch id.
- * @param documentId Format - uuid. The document id.
- * @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 document Status Response along with {@link Response} on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> getDocumentStatusWithResponse(String id, String documentId,
- RequestOptions requestOptions) {
- return this.serviceClient.getDocumentStatusWithResponseAsync(id, documentId, requestOptions);
- }
-
- /**
- * Returns the status for a document translation request
- *
- * Returns the status for a document translation request.
- * The status includes the
- * overall request status, as well as the status for documents that are being
- * translated as part of that request.
- * Response Body Schema
- *
- *
- * {@code
- * {
- * id: String (Required)
- * createdDateTimeUtc: OffsetDateTime (Required)
- * lastActionDateTimeUtc: OffsetDateTime (Required)
- * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
- * error (Optional): {
- * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): {
- * code: String (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): (recursive schema, see innerError above)
- * }
- * }
- * summary (Required): {
- * total: int (Required)
- * failed: int (Required)
- * success: int (Required)
- * inProgress: int (Required)
- * notYetStarted: int (Required)
- * cancelled: int (Required)
- * totalCharacterCharged: long (Required)
- * }
- * }
- * }
- *
+ * Query Parameters
+ *
+ * Query Parameters
+ * Name | Type | Required | Description |
+ * top | Integer | No | top indicates the total number of records the user wants to be
+ * returned across
+ * all pages.
*
- * @param id Format - uuid. The operation id.
- * @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 translation job status response along with {@link Response} on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> getTranslationStatusWithResponse(String id, RequestOptions requestOptions) {
- return this.serviceClient.getTranslationStatusWithResponseAsync(id, requestOptions);
- }
-
- /**
- * Cancel a currently processing or queued translation
+ * Clients MAY use top and skip query parameters to
+ * specify a number of results to return and an offset into the collection.
+ * When
+ * both top and skip are given by a client, the server SHOULD first apply skip
+ * and then top on the collection.
*
- * Cancel a currently processing or queued translation.
- * A translation will not be
- * cancelled if it is already completed or failed or cancelling. A bad request
- * will be returned.
- * All documents that have completed translation will not be
- * cancelled and will be charged.
- * All pending documents will be cancelled if
- * possible.
+ * Note: If the server can't honor
+ * top and/or skip, the server MUST return an error to the client informing
+ * about it instead of just ignoring the query options. |
+ * skip | Integer | No | skip indicates the number of records to skip from the list of
+ * records held by
+ * the server based on the sorting method specified. By default, we sort by
+ * descending start time.
+ *
+ * Clients MAY use top and skip query
+ * parameters to specify a number of results to return and an offset into the
+ * collection.
+ * When both top and skip are given by a client, the server SHOULD
+ * first apply skip and then top on the collection.
+ *
+ * Note: If the
+ * server can't honor top and/or skip, the server MUST return an error to the
+ * client informing about it instead of just ignoring the query options. |
+ * maxpagesize | Integer | No | maxpagesize is the maximum items returned in a page. If
+ * more items are
+ * requested via top (or top is not specified and there are more items to be
+ * returned), @nextLink will contain the link to the next page.
+ *
+ * Clients MAY request server-driven paging with a specific page size by
+ * specifying a maxpagesize preference. The server SHOULD honor this preference
+ * if the specified page size is smaller than the server's default page size. |
+ * ids | List<String> | No | Ids to use in filtering. In the form of "," separated
+ * string. |
+ * statuses | List<String> | No | Statuses to use in filtering. In the form of ","
+ * separated string. |
+ * createdDateTimeUtcStart | OffsetDateTime | No | the start datetime to get items
+ * after |
+ * createdDateTimeUtcEnd | OffsetDateTime | No | the end datetime to get items
+ * before |
+ * orderby | List<String> | No | the sorting query for the collection (ex:
+ * 'CreatedDateTimeUtc asc','CreatedDateTimeUtc desc'). In the form of "," separated string. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
* Response Body Schema
*
*
@@ -425,18 +616,17 @@ public Mono> getTranslationStatusWithResponse(String id, Re
* }
*
*
- * @param id Format - uuid. The operation-id.
* @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 translation job status response along with {@link Response} on successful completion of {@link Mono}.
+ * @return translation job Status Response as paginated response with {@link PagedFlux}.
*/
@Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> cancelTranslationWithResponse(String id, RequestOptions requestOptions) {
- return this.serviceClient.cancelTranslationWithResponseAsync(id, requestOptions);
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listTranslationStatuses(RequestOptions requestOptions) {
+ return this.serviceClient.listTranslationStatusesAsync(requestOptions);
}
/**
@@ -566,7 +756,7 @@ public Mono> cancelTranslationWithResponse(String id, Reque
* }
*
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -576,61 +766,8 @@ public Mono> cancelTranslationWithResponse(String id, Reque
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getDocumentsStatus(String id, RequestOptions requestOptions) {
- return this.serviceClient.getDocumentsStatusAsync(id, requestOptions);
- }
-
- /**
- * Returns a list of supported document formats
- *
- * The list of supported formats supported by the Document Translation
- * service.
- * The list includes the common file extension, as well as the
- * content-type if using the upload API.
- * Query Parameters
- *
- * Query Parameters
- * Name | Type | Required | Description |
- * type | String | No | the type of format like document or glossary . Allowed values:
- * "document", "glossary". |
- *
- * You can add these to a request with {@link RequestOptions#addQueryParam}
- * Response Body Schema
- *
- *
- * {@code
- * {
- * value (Required): [
- * (Required){
- * format: String (Required)
- * fileExtensions (Required): [
- * String (Required)
- * ]
- * contentTypes (Required): [
- * String (Required)
- * ]
- * defaultVersion: String (Optional)
- * versions (Optional): [
- * String (Optional)
- * ]
- * type: String (Optional)
- * }
- * ]
- * }
- * }
- *
- *
- * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
- * @throws HttpResponseException thrown if the request is rejected by server.
- * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
- * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
- * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return list of supported file formats along with {@link Response} on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> getSupportedFormatsWithResponse(RequestOptions requestOptions) {
- return this.serviceClient.getSupportedFormatsWithResponseAsync(requestOptions);
+ public PagedFlux listDocumentStatuses(String translationId, RequestOptions requestOptions) {
+ return this.serviceClient.listDocumentStatusesAsync(translationId, requestOptions);
}
/**
@@ -656,7 +793,7 @@ public Mono> getSupportedFormatsWithResponse(RequestOptions
* destination, it will be overwritten. The targetUrl for each target language
* must be unique.
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -667,12 +804,10 @@ public Mono> getSupportedFormatsWithResponse(RequestOptions
*/
@Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux
- beginStartTranslation(StartTranslationDetails startTranslationDetails) {
- // Generated convenience method for beginStartTranslationWithModel
+ public PollerFlux beginBeginTranslation(TranslationBatch body) {
+ // Generated convenience method for beginBeginTranslationWithModel
RequestOptions requestOptions = new RequestOptions();
- return serviceClient.beginStartTranslationWithModelAsync(BinaryData.fromObject(startTranslationDetails),
- requestOptions);
+ return serviceClient.beginBeginTranslationWithModelAsync(BinaryData.fromObject(body), requestOptions);
}
/**
@@ -754,7 +889,7 @@ public Mono> getSupportedFormatsWithResponse(RequestOptions
* Note: If the
* server can't honor top and/or skip, the server MUST return an error to the
* client informing about it instead of just ignoring the query options.
- * @param ids Ids to use in filtering.
+ * @param translationIds Ids to use in filtering.
* @param statuses Statuses to use in filtering.
* @param createdDateTimeUtcStart the start datetime to get items after.
* @param createdDateTimeUtcEnd the end datetime to get items before.
@@ -769,10 +904,10 @@ public Mono> getSupportedFormatsWithResponse(RequestOptions
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getTranslationsStatus(Integer top, Integer skip, List ids,
- List statuses, OffsetDateTime createdDateTimeUtcStart, OffsetDateTime createdDateTimeUtcEnd,
- List orderBy) {
- // Generated convenience method for getTranslationsStatus
+ public PagedFlux listTranslationStatuses(Integer top, Integer skip,
+ List translationIds, List statuses, OffsetDateTime createdDateTimeUtcStart,
+ OffsetDateTime createdDateTimeUtcEnd, List orderBy) {
+ // Generated convenience method for listTranslationStatuses
RequestOptions requestOptions = new RequestOptions();
if (top != null) {
requestOptions.addQueryParam("top", String.valueOf(top), false);
@@ -780,9 +915,9 @@ public PagedFlux getTranslationsStatus(Integer top, Integer s
if (skip != null) {
requestOptions.addQueryParam("skip", String.valueOf(skip), false);
}
- if (ids != null) {
+ if (translationIds != null) {
requestOptions.addQueryParam("ids",
- ids.stream()
+ translationIds.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.joining(",")),
false);
@@ -807,18 +942,19 @@ public PagedFlux getTranslationsStatus(Integer top, Integer s
.collect(Collectors.joining(",")),
false);
}
- PagedFlux pagedFluxResponse = getTranslationsStatus(requestOptions);
+ PagedFlux pagedFluxResponse = listTranslationStatuses(requestOptions);
return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
Flux> flux = (continuationTokenParam == null)
? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationTokenParam).take(1);
- return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
- pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue()
- .stream()
- .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatus.class))
- .collect(Collectors.toList()),
- pagedResponse.getContinuationToken(), null));
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatusResult.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
});
}
@@ -885,105 +1021,25 @@ public PagedFlux getTranslationsStatus(Integer top, Integer s
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getTranslationsStatus() {
- // Generated convenience method for getTranslationsStatus
+ public PagedFlux listTranslationStatuses() {
+ // Generated convenience method for listTranslationStatuses
RequestOptions requestOptions = new RequestOptions();
- PagedFlux pagedFluxResponse = getTranslationsStatus(requestOptions);
+ PagedFlux pagedFluxResponse = listTranslationStatuses(requestOptions);
return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
Flux> flux = (continuationTokenParam == null)
? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationTokenParam).take(1);
- return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
- pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue()
- .stream()
- .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatus.class))
- .collect(Collectors.toList()),
- pagedResponse.getContinuationToken(), null));
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatusResult.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
});
}
- /**
- * Returns the status for a specific document
- *
- * Returns the translation status for a specific document based on the request Id
- * and document Id.
- *
- * @param id Format - uuid. The batch id.
- * @param documentId Format - uuid. The document id.
- * @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 document Status Response on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getDocumentStatus(String id, String documentId) {
- // Generated convenience method for getDocumentStatusWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return getDocumentStatusWithResponse(id, documentId, requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(DocumentStatus.class));
- }
-
- /**
- * Returns the status for a document translation request
- *
- * Returns the status for a document translation request.
- * The status includes the
- * overall request status, as well as the status for documents that are being
- * translated as part of that request.
- *
- * @param id Format - uuid. The operation id.
- * @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 translation job status response on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getTranslationStatus(String id) {
- // Generated convenience method for getTranslationStatusWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return getTranslationStatusWithResponse(id, requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatus.class));
- }
-
- /**
- * Cancel a currently processing or queued translation
- *
- * Cancel a currently processing or queued translation.
- * A translation will not be
- * cancelled if it is already completed or failed or cancelling. A bad request
- * will be returned.
- * All documents that have completed translation will not be
- * cancelled and will be charged.
- * All pending documents will be cancelled if
- * possible.
- *
- * @param id Format - uuid. The operation-id.
- * @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 translation job status response on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono cancelTranslation(String id) {
- // Generated convenience method for cancelTranslationWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return cancelTranslationWithResponse(id, requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(TranslationStatus.class));
- }
-
/**
* Returns the status for all documents in a batch document translation request
*
@@ -1032,7 +1088,7 @@ public Mono cancelTranslation(String id) {
* This reduces the risk of the client making assumptions about
* the data returned.
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @param top top indicates the total number of records the user wants to be returned across
* all pages.
*
@@ -1058,7 +1114,7 @@ public Mono cancelTranslation(String id) {
* Note: If the
* server can't honor top and/or skip, the server MUST return an error to the
* client informing about it instead of just ignoring the query options.
- * @param ids Ids to use in filtering.
+ * @param documentIds Ids to use in filtering.
* @param statuses Statuses to use in filtering.
* @param createdDateTimeUtcStart the start datetime to get items after.
* @param createdDateTimeUtcEnd the end datetime to get items before.
@@ -1073,10 +1129,10 @@ public Mono cancelTranslation(String id) {
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getDocumentsStatus(String id, Integer top, Integer skip, List ids,
- List statuses, OffsetDateTime createdDateTimeUtcStart, OffsetDateTime createdDateTimeUtcEnd,
- List orderBy) {
- // Generated convenience method for getDocumentsStatus
+ public PagedFlux listDocumentStatuses(String translationId, Integer top, Integer skip,
+ List documentIds, List statuses, OffsetDateTime createdDateTimeUtcStart,
+ OffsetDateTime createdDateTimeUtcEnd, List orderBy) {
+ // Generated convenience method for listDocumentStatuses
RequestOptions requestOptions = new RequestOptions();
if (top != null) {
requestOptions.addQueryParam("top", String.valueOf(top), false);
@@ -1084,9 +1140,9 @@ public PagedFlux getDocumentsStatus(String id, Integer top, Inte
if (skip != null) {
requestOptions.addQueryParam("skip", String.valueOf(skip), false);
}
- if (ids != null) {
+ if (documentIds != null) {
requestOptions.addQueryParam("ids",
- ids.stream()
+ documentIds.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.joining(",")),
false);
@@ -1111,7 +1167,7 @@ public PagedFlux getDocumentsStatus(String id, Integer top, Inte
.collect(Collectors.joining(",")),
false);
}
- PagedFlux pagedFluxResponse = getDocumentsStatus(id, requestOptions);
+ PagedFlux pagedFluxResponse = listDocumentStatuses(translationId, requestOptions);
return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
Flux> flux = (continuationTokenParam == null)
? pagedFluxResponse.byPage().take(1)
@@ -1174,7 +1230,7 @@ public PagedFlux getDocumentsStatus(String id, Integer top, Inte
* This reduces the risk of the client making assumptions about
* the data returned.
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -1185,10 +1241,10 @@ public PagedFlux getDocumentsStatus(String id, Integer top, Inte
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getDocumentsStatus(String id) {
- // Generated convenience method for getDocumentsStatus
+ public PagedFlux listDocumentStatuses(String translationId) {
+ // Generated convenience method for listDocumentStatuses
RequestOptions requestOptions = new RequestOptions();
- PagedFlux pagedFluxResponse = getDocumentsStatus(id, requestOptions);
+ PagedFlux pagedFluxResponse = listDocumentStatuses(translationId, requestOptions);
return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
Flux> flux = (continuationTokenParam == null)
? pagedFluxResponse.byPage().take(1)
@@ -1202,57 +1258,4 @@ public PagedFlux getDocumentsStatus(String id) {
pagedResponse.getContinuationToken(), null));
});
}
-
- /**
- * Returns a list of supported document formats
- *
- * The list of supported formats supported by the Document Translation
- * service.
- * The list includes the common file extension, as well as the
- * content-type if using the upload API.
- *
- * @param type the type of format like document or glossary.
- * @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 list of supported file formats on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getSupportedFormats(FileFormatType type) {
- // Generated convenience method for getSupportedFormatsWithResponse
- RequestOptions requestOptions = new RequestOptions();
- if (type != null) {
- requestOptions.addQueryParam("type", type.toString(), false);
- }
- return getSupportedFormatsWithResponse(requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(SupportedFileFormats.class));
- }
-
- /**
- * Returns a list of supported document formats
- *
- * The list of supported formats supported by the Document Translation
- * service.
- * The list includes the common file extension, as well as the
- * content-type if using the upload API.
- *
- * @throws HttpResponseException thrown if the request is rejected by server.
- * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
- * @throws ResourceNotFoundException thrown if 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 list of supported file formats on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getSupportedFormats() {
- // Generated convenience method for getSupportedFormatsWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return getSupportedFormatsWithResponse(requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(SupportedFileFormats.class));
- }
}
diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationClient.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationClient.java
index ebbcc4836438a..06f4efa06b6bc 100644
--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationClient.java
+++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationClient.java
@@ -4,11 +4,13 @@
package com.azure.ai.translation.document;
import com.azure.ai.translation.document.implementation.DocumentTranslationClientImpl;
+import com.azure.ai.translation.document.implementation.models.FileFormatType;
+import com.azure.ai.translation.document.implementation.models.SupportedFileFormats;
import com.azure.ai.translation.document.models.DocumentStatus;
import com.azure.ai.translation.document.models.FileFormatType;
-import com.azure.ai.translation.document.models.StartTranslationDetails;
import com.azure.ai.translation.document.models.SupportedFileFormats;
-import com.azure.ai.translation.document.models.TranslationStatus;
+import com.azure.ai.translation.document.models.TranslationBatch;
+import com.azure.ai.translation.document.models.TranslationStatusResult;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
@@ -47,185 +49,62 @@ public final class DocumentTranslationClient {
}
/**
- * Submit a document translation request to the Document Translation service
- *
- * Use this API to submit a bulk (batch) translation request to the Document
- * Translation service.
- * Each request can contain multiple documents and must
- * contain a source and destination container for each document.
- *
- * The
- * prefix and suffix filter (if supplied) are used to filter folders. The prefix
- * is applied to the subpath after the container name.
- *
- * Glossaries /
- * Translation memory can be included in the request and are applied by the
- * service when the document is translated.
+ * Returns the status for a specific document
*
- * If the glossary is
- * invalid or unreachable during translation, an error is indicated in the
- * document status.
- * If a file with the same name already exists at the
- * destination, it will be overwritten. The targetUrl for each target language
- * must be unique.
- * Request Body Schema
+ * Returns the translation status for a specific document based on the request Id
+ * and document Id.
+ * Response Body Schema
*
*
* {@code
* {
- * inputs (Required): [
- * (Required){
- * source (Required): {
- * sourceUrl: String (Required)
- * filter (Optional): {
- * prefix: String (Optional)
- * suffix: String (Optional)
- * }
- * language: String (Optional)
- * storageSource: String(AzureBlob) (Optional)
- * }
- * targets (Required): [
- * (Required){
- * targetUrl: String (Required)
- * category: String (Optional)
- * language: String (Required)
- * glossaries (Optional): [
- * (Optional){
- * glossaryUrl: String (Required)
- * format: String (Required)
- * version: String (Optional)
- * storageSource: String(AzureBlob) (Optional)
- * }
- * ]
- * storageSource: String(AzureBlob) (Optional)
- * }
- * ]
- * storageType: String(Folder/File) (Optional)
+ * path: String (Optional)
+ * sourcePath: String (Required)
+ * createdDateTimeUtc: OffsetDateTime (Required)
+ * lastActionDateTimeUtc: OffsetDateTime (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
+ * to: String (Required)
+ * error (Optional): {
+ * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * innerError (Optional): (recursive schema, see innerError above)
* }
- * ]
+ * }
+ * progress: double (Required)
+ * id: String (Required)
+ * characterCharged: Integer (Optional)
* }
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param translationId Format - uuid. The batch id.
+ * @param documentId Format - uuid. The document id.
* @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.
+ * @return document Status Response along with {@link Response}.
*/
@Generated
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller beginStartTranslation(BinaryData startTranslationDetails,
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getDocumentStatusWithResponse(String translationId, String documentId,
RequestOptions requestOptions) {
- return this.serviceClient.beginStartTranslation(startTranslationDetails, requestOptions);
+ return this.serviceClient.getDocumentStatusWithResponse(translationId, documentId, requestOptions);
}
/**
- * Returns a list of batch requests submitted and the status for each request
- *
- * Returns a list of batch requests submitted and the status for each
- * request.
- * This list only contains batch requests submitted by the user (based on
- * the resource).
- *
- * If the number of requests exceeds our paging limit,
- * server-side paging is used. Paginated responses indicate a partial result and
- * include a continuation token in the response.
- * The absence of a continuation
- * token means that no additional pages are available.
- *
- * top, skip
- * and maxpagesize query parameters can be used to specify a number of results to
- * return and an offset for the collection.
- *
- * top indicates the total
- * number of records the user wants to be returned across all pages.
- * skip
- * indicates the number of records to skip from the list of batches based on the
- * sorting method specified. By default, we sort by descending start
- * time.
- * maxpagesize is the maximum items returned in a page. If more items are
- * requested via top (or top is not specified and there are more items to be
- * returned), @nextLink will contain the link to the next page.
- *
- * orderby query parameter can be used to sort the returned list (ex
- * "orderby=createdDateTimeUtc asc" or "orderby=createdDateTimeUtc
- * desc").
- * The default sorting is descending by createdDateTimeUtc.
- * Some query
- * parameters can be used to filter the returned list (ex:
- * "status=Succeeded,Cancelled") will only return succeeded and cancelled
- * operations.
- * createdDateTimeUtcStart and createdDateTimeUtcEnd can be used
- * combined or separately to specify a range of datetime to filter the returned
- * list by.
- * The supported filtering query parameters are (status, ids,
- * createdDateTimeUtcStart, createdDateTimeUtcEnd).
- *
- * The server honors
- * the values specified by the client. However, clients must be prepared to handle
- * responses that contain a different page size or contain a continuation token.
- *
- * When both top and skip are included, the server should first apply
- * skip and then top on the collection.
- * Note: If the server can't honor top
- * and/or skip, the server must return an error to the client informing about it
- * instead of just ignoring the query options.
- * This reduces the risk of the client
- * making assumptions about the data returned.
- * Query Parameters
- *
- * Query Parameters
- * Name | Type | Required | Description |
- * top | Integer | No | top indicates the total number of records the user wants to be
- * returned across
- * all pages.
- *
- * Clients MAY use top and skip query parameters to
- * specify a number of results to return and an offset into the collection.
- * When
- * both top and skip are given by a client, the server SHOULD first apply skip
- * and then top on the collection.
- *
- * Note: If the server can't honor
- * top and/or skip, the server MUST return an error to the client informing
- * about it instead of just ignoring the query options. |
- * skip | Integer | No | skip indicates the number of records to skip from the list of
- * records held by
- * the server based on the sorting method specified. By default, we sort by
- * descending start time.
- *
- * Clients MAY use top and skip query
- * parameters to specify a number of results to return and an offset into the
- * collection.
- * When both top and skip are given by a client, the server SHOULD
- * first apply skip and then top on the collection.
- *
- * Note: If the
- * server can't honor top and/or skip, the server MUST return an error to the
- * client informing about it instead of just ignoring the query options. |
- * maxpagesize | Integer | No | maxpagesize is the maximum items returned in a page. If
- * more items are
- * requested via top (or top is not specified and there are more items to be
- * returned), @nextLink will contain the link to the next page.
+ * Returns the status for a document translation request
*
- * Clients MAY request server-driven paging with a specific page size by
- * specifying a maxpagesize preference. The server SHOULD honor this preference
- * if the specified page size is smaller than the server's default page size. |
- * ids | List<String> | No | Ids to use in filtering. In the form of "," separated
- * string. |
- * statuses | List<String> | No | Statuses to use in filtering. In the form of ","
- * separated string. |
- * createdDateTimeUtcStart | OffsetDateTime | No | the start datetime to get items
- * after |
- * createdDateTimeUtcEnd | OffsetDateTime | No | the end datetime to get items
- * before |
- * orderby | List<String> | No | the sorting query for the collection (ex:
- * 'CreatedDateTimeUtc asc','CreatedDateTimeUtc desc'). In the form of "," separated string. |
- *
- * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Returns the status for a document translation request.
+ * The status includes the
+ * overall request status, as well as the status for documents that are being
+ * translated as part of that request.
* Response Body Schema
*
*
@@ -259,35 +138,40 @@ public SyncPoller beginStartTranslation(BinaryData start
* }
*
*
+ * @param translationId Format - uuid. The operation id.
* @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 translation job Status Response as paginated response with {@link PagedIterable}.
+ * @return translation job status response along with {@link Response}.
*/
@Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getTranslationsStatus(RequestOptions requestOptions) {
- return this.serviceClient.getTranslationsStatus(requestOptions);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getTranslationStatusWithResponse(String translationId, RequestOptions requestOptions) {
+ return this.serviceClient.getTranslationStatusWithResponse(translationId, requestOptions);
}
/**
- * Returns the status for a specific document
+ * Cancel a currently processing or queued translation
*
- * Returns the translation status for a specific document based on the request Id
- * and document Id.
+ * Cancel a currently processing or queued translation.
+ * A translation will not be
+ * cancelled if it is already completed or failed or cancelling. A bad request
+ * will be returned.
+ * All documents that have completed translation will not be
+ * cancelled and will be charged.
+ * All pending documents will be cancelled if
+ * possible.
* Response Body Schema
*
*
* {@code
* {
- * path: String (Optional)
- * sourcePath: String (Required)
+ * id: String (Required)
* createdDateTimeUtc: OffsetDateTime (Required)
* lastActionDateTimeUtc: OffsetDateTime (Required)
* status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
- * to: String (Required)
* error (Optional): {
* code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
* message: String (Required)
@@ -299,27 +183,109 @@ public PagedIterable getTranslationsStatus(RequestOptions requestOpt
* innerError (Optional): (recursive schema, see innerError above)
* }
* }
- * progress: double (Required)
- * id: String (Required)
- * characterCharged: Integer (Optional)
+ * summary (Required): {
+ * total: int (Required)
+ * failed: int (Required)
+ * success: int (Required)
+ * inProgress: int (Required)
+ * notYetStarted: int (Required)
+ * cancelled: int (Required)
+ * totalCharacterCharged: long (Required)
+ * }
* }
* }
*
*
- * @param id Format - uuid. The batch id.
- * @param documentId Format - uuid. The document id.
+ * @param translationId Format - uuid. The operation-id.
* @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 document Status Response along with {@link Response}.
+ * @return translation job status response along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getDocumentStatusWithResponse(String id, String documentId,
- RequestOptions requestOptions) {
- return this.serviceClient.getDocumentStatusWithResponse(id, documentId, requestOptions);
+ public Response cancelTranslationWithResponse(String translationId, RequestOptions requestOptions) {
+ return this.serviceClient.cancelTranslationWithResponse(translationId, requestOptions);
+ }
+
+ /**
+ * Returns a list of supported document formats
+ *
+ * The list of supported formats supported by the Document Translation
+ * service.
+ * The list includes the common file extension, as well as the
+ * content-type if using the upload API.
+ * Query Parameters
+ *
+ * Query Parameters
+ * Name | Type | Required | Description |
+ * type | String | No | the type of format like document or glossary . Allowed values:
+ * "document", "glossary". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * value (Required): [
+ * (Required){
+ * format: String (Required)
+ * fileExtensions (Required): [
+ * String (Required)
+ * ]
+ * contentTypes (Required): [
+ * String (Required)
+ * ]
+ * defaultVersion: String (Optional)
+ * versions (Optional): [
+ * String (Optional)
+ * ]
+ * type: String(document/glossary) (Optional)
+ * }
+ * ]
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return list of supported file formats along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getSupportedFormatsWithResponse(RequestOptions requestOptions) {
+ return this.serviceClient.getSupportedFormatsWithResponse(requestOptions);
+ }
+
+ /**
+ * Returns the status for a specific document
+ *
+ * Returns the translation status for a specific document based on the request Id
+ * and document Id.
+ *
+ * @param translationId Format - uuid. The batch id.
+ * @param documentId Format - uuid. The document id.
+ * @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 document Status Response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DocumentStatus getDocumentStatus(String translationId, String documentId) {
+ // Generated convenience method for getDocumentStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getDocumentStatusWithResponse(translationId, documentId, requestOptions).getValue()
+ .toObject(DocumentStatus.class);
}
/**
@@ -329,64 +295,285 @@ public Response getDocumentStatusWithResponse(String id, String docu
* The status includes the
* overall request status, as well as the status for documents that are being
* translated as part of that request.
- * Response Body Schema
+ *
+ * @param translationId Format - uuid. The operation id.
+ * @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 translation job status response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TranslationStatusResult getTranslationStatus(String translationId) {
+ // Generated convenience method for getTranslationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getTranslationStatusWithResponse(translationId, requestOptions).getValue()
+ .toObject(TranslationStatusResult.class);
+ }
+
+ /**
+ * Cancel a currently processing or queued translation
+ *
+ * Cancel a currently processing or queued translation.
+ * A translation will not be
+ * cancelled if it is already completed or failed or cancelling. A bad request
+ * will be returned.
+ * All documents that have completed translation will not be
+ * cancelled and will be charged.
+ * All pending documents will be cancelled if
+ * possible.
+ *
+ * @param translationId Format - uuid. The operation-id.
+ * @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 translation job status response.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TranslationStatusResult cancelTranslation(String translationId) {
+ // Generated convenience method for cancelTranslationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return cancelTranslationWithResponse(translationId, requestOptions).getValue()
+ .toObject(TranslationStatusResult.class);
+ }
+
+ /**
+ * Returns a list of supported document formats
+ *
+ * The list of supported formats supported by the Document Translation
+ * service.
+ * The list includes the common file extension, as well as the
+ * content-type if using the upload API.
+ *
+ * @param type the type of format like document or glossary.
+ * @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 list of supported file formats.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SupportedFileFormats getSupportedFormats(FileFormatType type) {
+ // Generated convenience method for getSupportedFormatsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (type != null) {
+ requestOptions.addQueryParam("type", type.toString(), false);
+ }
+ return getSupportedFormatsWithResponse(requestOptions).getValue().toObject(SupportedFileFormats.class);
+ }
+
+ /**
+ * Returns a list of supported document formats
+ *
+ * The list of supported formats supported by the Document Translation
+ * service.
+ * The list includes the common file extension, as well as the
+ * content-type if using the upload API.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if 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 list of supported file formats.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SupportedFileFormats getSupportedFormats() {
+ // Generated convenience method for getSupportedFormatsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getSupportedFormatsWithResponse(requestOptions).getValue().toObject(SupportedFileFormats.class);
+ }
+
+ /**
+ * Submit a document translation request to the Document Translation service
+ *
+ * Use this API to submit a bulk (batch) translation request to the Document
+ * Translation service.
+ * Each request can contain multiple documents and must
+ * contain a source and destination container for each document.
+ *
+ * The
+ * prefix and suffix filter (if supplied) are used to filter folders. The prefix
+ * is applied to the subpath after the container name.
+ *
+ * Glossaries /
+ * Translation memory can be included in the request and are applied by the
+ * service when the document is translated.
+ *
+ * If the glossary is
+ * invalid or unreachable during translation, an error is indicated in the
+ * document status.
+ * If a file with the same name already exists at the
+ * destination, it will be overwritten. The targetUrl for each target language
+ * must be unique.
+ * Request Body Schema
*
*
* {@code
* {
- * id: String (Required)
- * createdDateTimeUtc: OffsetDateTime (Required)
- * lastActionDateTimeUtc: OffsetDateTime (Required)
- * status: String(NotStarted/Running/Succeeded/Failed/Cancelled/Cancelling/ValidationFailed) (Required)
- * error (Optional): {
- * code: String(InvalidRequest/InvalidArgument/InternalServerError/ServiceUnavailable/ResourceNotFound/Unauthorized/RequestRateTooHigh) (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): {
- * code: String (Required)
- * message: String (Required)
- * target: String (Optional)
- * innerError (Optional): (recursive schema, see innerError above)
+ * inputs (Required): [
+ * (Required){
+ * source (Required): {
+ * sourceUrl: String (Required)
+ * filter (Optional): {
+ * prefix: String (Optional)
+ * suffix: String (Optional)
+ * }
+ * language: String (Optional)
+ * storageSource: String(AzureBlob) (Optional)
+ * }
+ * targets (Required): [
+ * (Required){
+ * targetUrl: String (Required)
+ * category: String (Optional)
+ * language: String (Required)
+ * glossaries (Optional): [
+ * (Optional){
+ * glossaryUrl: String (Required)
+ * format: String (Required)
+ * version: String (Optional)
+ * storageSource: String(AzureBlob) (Optional)
+ * }
+ * ]
+ * storageSource: String(AzureBlob) (Optional)
+ * }
+ * ]
+ * storageType: String(Folder/File) (Optional)
* }
- * }
- * summary (Required): {
- * total: int (Required)
- * failed: int (Required)
- * success: int (Required)
- * inProgress: int (Required)
- * notYetStarted: int (Required)
- * cancelled: int (Required)
- * totalCharacterCharged: long (Required)
- * }
+ * ]
* }
* }
*
*
- * @param id Format - uuid. The operation id.
- * @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 translation job status response along with {@link Response}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response getTranslationStatusWithResponse(String id, RequestOptions requestOptions) {
- return this.serviceClient.getTranslationStatusWithResponse(id, requestOptions);
- }
-
- /**
- * Cancel a currently processing or queued translation
+ * @param body Translation job submission batch request.
+ * @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 beginBeginTranslation(BinaryData body, RequestOptions requestOptions) {
+ return this.serviceClient.beginBeginTranslation(body, requestOptions);
+ }
+
+ /**
+ * Returns a list of batch requests submitted and the status for each request
+ *
+ * Returns a list of batch requests submitted and the status for each
+ * request.
+ * This list only contains batch requests submitted by the user (based on
+ * the resource).
+ *
+ * If the number of requests exceeds our paging limit,
+ * server-side paging is used. Paginated responses indicate a partial result and
+ * include a continuation token in the response.
+ * The absence of a continuation
+ * token means that no additional pages are available.
+ *
+ * top, skip
+ * and maxpagesize query parameters can be used to specify a number of results to
+ * return and an offset for the collection.
+ *
+ * top indicates the total
+ * number of records the user wants to be returned across all pages.
+ * skip
+ * indicates the number of records to skip from the list of batches based on the
+ * sorting method specified. By default, we sort by descending start
+ * time.
+ * maxpagesize is the maximum items returned in a page. If more items are
+ * requested via top (or top is not specified and there are more items to be
+ * returned), @nextLink will contain the link to the next page.
+ *
+ * orderby query parameter can be used to sort the returned list (ex
+ * "orderby=createdDateTimeUtc asc" or "orderby=createdDateTimeUtc
+ * desc").
+ * The default sorting is descending by createdDateTimeUtc.
+ * Some query
+ * parameters can be used to filter the returned list (ex:
+ * "status=Succeeded,Cancelled") will only return succeeded and cancelled
+ * operations.
+ * createdDateTimeUtcStart and createdDateTimeUtcEnd can be used
+ * combined or separately to specify a range of datetime to filter the returned
+ * list by.
+ * The supported filtering query parameters are (status, ids,
+ * createdDateTimeUtcStart, createdDateTimeUtcEnd).
+ *
+ * The server honors
+ * the values specified by the client. However, clients must be prepared to handle
+ * responses that contain a different page size or contain a continuation token.
*
- * Cancel a currently processing or queued translation.
- * A translation will not be
- * cancelled if it is already completed or failed or cancelling. A bad request
- * will be returned.
- * All documents that have completed translation will not be
- * cancelled and will be charged.
- * All pending documents will be cancelled if
- * possible.
+ * When both top and skip are included, the server should first apply
+ * skip and then top on the collection.
+ * Note: If the server can't honor top
+ * and/or skip, the server must return an error to the client informing about it
+ * instead of just ignoring the query options.
+ * This reduces the risk of the client
+ * making assumptions about the data returned.
+ * Query Parameters
+ *
+ * Query Parameters
+ * Name | Type | Required | Description |
+ * top | Integer | No | top indicates the total number of records the user wants to be
+ * returned across
+ * all pages.
+ *
+ * Clients MAY use top and skip query parameters to
+ * specify a number of results to return and an offset into the collection.
+ * When
+ * both top and skip are given by a client, the server SHOULD first apply skip
+ * and then top on the collection.
+ *
+ * Note: If the server can't honor
+ * top and/or skip, the server MUST return an error to the client informing
+ * about it instead of just ignoring the query options. |
+ * skip | Integer | No | skip indicates the number of records to skip from the list of
+ * records held by
+ * the server based on the sorting method specified. By default, we sort by
+ * descending start time.
+ *
+ * Clients MAY use top and skip query
+ * parameters to specify a number of results to return and an offset into the
+ * collection.
+ * When both top and skip are given by a client, the server SHOULD
+ * first apply skip and then top on the collection.
+ *
+ * Note: If the
+ * server can't honor top and/or skip, the server MUST return an error to the
+ * client informing about it instead of just ignoring the query options. |
+ * maxpagesize | Integer | No | maxpagesize is the maximum items returned in a page. If
+ * more items are
+ * requested via top (or top is not specified and there are more items to be
+ * returned), @nextLink will contain the link to the next page.
+ *
+ * Clients MAY request server-driven paging with a specific page size by
+ * specifying a maxpagesize preference. The server SHOULD honor this preference
+ * if the specified page size is smaller than the server's default page size. |
+ * ids | List<String> | No | Ids to use in filtering. In the form of "," separated
+ * string. |
+ * statuses | List<String> | No | Statuses to use in filtering. In the form of ","
+ * separated string. |
+ * createdDateTimeUtcStart | OffsetDateTime | No | the start datetime to get items
+ * after |
+ * createdDateTimeUtcEnd | OffsetDateTime | No | the end datetime to get items
+ * before |
+ * orderby | List<String> | No | the sorting query for the collection (ex:
+ * 'CreatedDateTimeUtc asc','CreatedDateTimeUtc desc'). In the form of "," separated string. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
* Response Body Schema
*
*
@@ -420,18 +607,17 @@ public Response getTranslationStatusWithResponse(String id, RequestO
* }
*
*
- * @param id Format - uuid. The operation-id.
* @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 translation job status response along with {@link Response}.
+ * @return translation job Status Response as paginated response with {@link PagedIterable}.
*/
@Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response cancelTranslationWithResponse(String id, RequestOptions requestOptions) {
- return this.serviceClient.cancelTranslationWithResponse(id, requestOptions);
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listTranslationStatuses(RequestOptions requestOptions) {
+ return this.serviceClient.listTranslationStatuses(requestOptions);
}
/**
@@ -561,7 +747,7 @@ public Response cancelTranslationWithResponse(String id, RequestOpti
* }
*
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -571,61 +757,8 @@ public Response cancelTranslationWithResponse(String id, RequestOpti
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getDocumentsStatus(String id, RequestOptions requestOptions) {
- return this.serviceClient.getDocumentsStatus(id, requestOptions);
- }
-
- /**
- * Returns a list of supported document formats
- *
- * The list of supported formats supported by the Document Translation
- * service.
- * The list includes the common file extension, as well as the
- * content-type if using the upload API.
- * Query Parameters
- *
- * Query Parameters
- * Name | Type | Required | Description |
- * type | String | No | the type of format like document or glossary . Allowed values:
- * "document", "glossary". |
- *
- * You can add these to a request with {@link RequestOptions#addQueryParam}
- * Response Body Schema
- *
- *
- * {@code
- * {
- * value (Required): [
- * (Required){
- * format: String (Required)
- * fileExtensions (Required): [
- * String (Required)
- * ]
- * contentTypes (Required): [
- * String (Required)
- * ]
- * defaultVersion: String (Optional)
- * versions (Optional): [
- * String (Optional)
- * ]
- * type: String (Optional)
- * }
- * ]
- * }
- * }
- *
- *
- * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
- * @throws HttpResponseException thrown if the request is rejected by server.
- * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
- * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
- * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return list of supported file formats along with {@link Response}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response getSupportedFormatsWithResponse(RequestOptions requestOptions) {
- return this.serviceClient.getSupportedFormatsWithResponse(requestOptions);
+ public PagedIterable listDocumentStatuses(String translationId, RequestOptions requestOptions) {
+ return this.serviceClient.listDocumentStatuses(translationId, requestOptions);
}
/**
@@ -651,7 +784,7 @@ public Response getSupportedFormatsWithResponse(RequestOptions reque
* destination, it will be overwritten. The targetUrl for each target language
* must be unique.
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -662,12 +795,10 @@ public Response getSupportedFormatsWithResponse(RequestOptions reque
*/
@Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller
- beginStartTranslation(StartTranslationDetails startTranslationDetails) {
- // Generated convenience method for beginStartTranslationWithModel
+ public SyncPoller beginBeginTranslation(TranslationBatch body) {
+ // Generated convenience method for beginBeginTranslationWithModel
RequestOptions requestOptions = new RequestOptions();
- return serviceClient.beginStartTranslationWithModel(BinaryData.fromObject(startTranslationDetails),
- requestOptions);
+ return serviceClient.beginBeginTranslationWithModel(BinaryData.fromObject(body), requestOptions);
}
/**
@@ -749,7 +880,7 @@ public Response getSupportedFormatsWithResponse(RequestOptions reque
* Note: If the
* server can't honor top and/or skip, the server MUST return an error to the
* client informing about it instead of just ignoring the query options.
- * @param ids Ids to use in filtering.
+ * @param translationIds Ids to use in filtering.
* @param statuses Statuses to use in filtering.
* @param createdDateTimeUtcStart the start datetime to get items after.
* @param createdDateTimeUtcEnd the end datetime to get items before.
@@ -764,10 +895,10 @@ public Response getSupportedFormatsWithResponse(RequestOptions reque
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getTranslationsStatus(Integer top, Integer skip, List ids,
- List statuses, OffsetDateTime createdDateTimeUtcStart, OffsetDateTime createdDateTimeUtcEnd,
- List orderBy) {
- // Generated convenience method for getTranslationsStatus
+ public PagedIterable listTranslationStatuses(Integer top, Integer skip,
+ List translationIds, List statuses, OffsetDateTime createdDateTimeUtcStart,
+ OffsetDateTime createdDateTimeUtcEnd, List orderBy) {
+ // Generated convenience method for listTranslationStatuses
RequestOptions requestOptions = new RequestOptions();
if (top != null) {
requestOptions.addQueryParam("top", String.valueOf(top), false);
@@ -775,9 +906,9 @@ public PagedIterable getTranslationsStatus(Integer top, Integ
if (skip != null) {
requestOptions.addQueryParam("skip", String.valueOf(skip), false);
}
- if (ids != null) {
+ if (translationIds != null) {
requestOptions.addQueryParam("ids",
- ids.stream()
+ translationIds.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.joining(",")),
false);
@@ -802,8 +933,8 @@ public PagedIterable getTranslationsStatus(Integer top, Integ
.collect(Collectors.joining(",")),
false);
}
- return serviceClient.getTranslationsStatus(requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(TranslationStatus.class));
+ return serviceClient.listTranslationStatuses(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TranslationStatusResult.class));
}
/**
@@ -869,89 +1000,11 @@ public PagedIterable getTranslationsStatus(Integer top, Integ
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getTranslationsStatus() {
- // Generated convenience method for getTranslationsStatus
- RequestOptions requestOptions = new RequestOptions();
- return serviceClient.getTranslationsStatus(requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(TranslationStatus.class));
- }
-
- /**
- * Returns the status for a specific document
- *
- * Returns the translation status for a specific document based on the request Id
- * and document Id.
- *
- * @param id Format - uuid. The batch id.
- * @param documentId Format - uuid. The document id.
- * @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 document Status Response.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public DocumentStatus getDocumentStatus(String id, String documentId) {
- // Generated convenience method for getDocumentStatusWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return getDocumentStatusWithResponse(id, documentId, requestOptions).getValue().toObject(DocumentStatus.class);
- }
-
- /**
- * Returns the status for a document translation request
- *
- * Returns the status for a document translation request.
- * The status includes the
- * overall request status, as well as the status for documents that are being
- * translated as part of that request.
- *
- * @param id Format - uuid. The operation id.
- * @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 translation job status response.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public TranslationStatus getTranslationStatus(String id) {
- // Generated convenience method for getTranslationStatusWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return getTranslationStatusWithResponse(id, requestOptions).getValue().toObject(TranslationStatus.class);
- }
-
- /**
- * Cancel a currently processing or queued translation
- *
- * Cancel a currently processing or queued translation.
- * A translation will not be
- * cancelled if it is already completed or failed or cancelling. A bad request
- * will be returned.
- * All documents that have completed translation will not be
- * cancelled and will be charged.
- * All pending documents will be cancelled if
- * possible.
- *
- * @param id Format - uuid. The operation-id.
- * @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 translation job status response.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public TranslationStatus cancelTranslation(String id) {
- // Generated convenience method for cancelTranslationWithResponse
+ public PagedIterable listTranslationStatuses() {
+ // Generated convenience method for listTranslationStatuses
RequestOptions requestOptions = new RequestOptions();
- return cancelTranslationWithResponse(id, requestOptions).getValue().toObject(TranslationStatus.class);
+ return serviceClient.listTranslationStatuses(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(TranslationStatusResult.class));
}
/**
@@ -1002,7 +1055,7 @@ public TranslationStatus cancelTranslation(String id) {
* This reduces the risk of the client making assumptions about
* the data returned.
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @param top top indicates the total number of records the user wants to be returned across
* all pages.
*
@@ -1028,7 +1081,7 @@ public TranslationStatus cancelTranslation(String id) {
* Note: If the
* server can't honor top and/or skip, the server MUST return an error to the
* client informing about it instead of just ignoring the query options.
- * @param ids Ids to use in filtering.
+ * @param documentIds Ids to use in filtering.
* @param statuses Statuses to use in filtering.
* @param createdDateTimeUtcStart the start datetime to get items after.
* @param createdDateTimeUtcEnd the end datetime to get items before.
@@ -1043,10 +1096,10 @@ public TranslationStatus cancelTranslation(String id) {
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getDocumentsStatus(String id, Integer top, Integer skip, List ids,
- List statuses, OffsetDateTime createdDateTimeUtcStart, OffsetDateTime createdDateTimeUtcEnd,
- List orderBy) {
- // Generated convenience method for getDocumentsStatus
+ public PagedIterable listDocumentStatuses(String translationId, Integer top, Integer skip,
+ List documentIds, List statuses, OffsetDateTime createdDateTimeUtcStart,
+ OffsetDateTime createdDateTimeUtcEnd, List orderBy) {
+ // Generated convenience method for listDocumentStatuses
RequestOptions requestOptions = new RequestOptions();
if (top != null) {
requestOptions.addQueryParam("top", String.valueOf(top), false);
@@ -1054,9 +1107,9 @@ public PagedIterable getDocumentsStatus(String id, Integer top,
if (skip != null) {
requestOptions.addQueryParam("skip", String.valueOf(skip), false);
}
- if (ids != null) {
+ if (documentIds != null) {
requestOptions.addQueryParam("ids",
- ids.stream()
+ documentIds.stream()
.map(paramItemValue -> Objects.toString(paramItemValue, ""))
.collect(Collectors.joining(",")),
false);
@@ -1081,7 +1134,7 @@ public PagedIterable getDocumentsStatus(String id, Integer top,
.collect(Collectors.joining(",")),
false);
}
- return serviceClient.getDocumentsStatus(id, requestOptions)
+ return serviceClient.listDocumentStatuses(translationId, requestOptions)
.mapPage(bodyItemValue -> bodyItemValue.toObject(DocumentStatus.class));
}
@@ -1133,7 +1186,7 @@ public PagedIterable getDocumentsStatus(String id, Integer top,
* This reduces the risk of the client making assumptions about
* the data returned.
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -1144,61 +1197,10 @@ public PagedIterable getDocumentsStatus(String id, Integer top,
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getDocumentsStatus(String id) {
- // Generated convenience method for getDocumentsStatus
+ public PagedIterable listDocumentStatuses(String translationId) {
+ // Generated convenience method for listDocumentStatuses
RequestOptions requestOptions = new RequestOptions();
- return serviceClient.getDocumentsStatus(id, requestOptions)
+ return serviceClient.listDocumentStatuses(translationId, requestOptions)
.mapPage(bodyItemValue -> bodyItemValue.toObject(DocumentStatus.class));
}
-
- /**
- * Returns a list of supported document formats
- *
- * The list of supported formats supported by the Document Translation
- * service.
- * The list includes the common file extension, as well as the
- * content-type if using the upload API.
- *
- * @param type the type of format like document or glossary.
- * @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 list of supported file formats.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public SupportedFileFormats getSupportedFormats(FileFormatType type) {
- // Generated convenience method for getSupportedFormatsWithResponse
- RequestOptions requestOptions = new RequestOptions();
- if (type != null) {
- requestOptions.addQueryParam("type", type.toString(), false);
- }
- return getSupportedFormatsWithResponse(requestOptions).getValue().toObject(SupportedFileFormats.class);
- }
-
- /**
- * Returns a list of supported document formats
- *
- * The list of supported formats supported by the Document Translation
- * service.
- * The list includes the common file extension, as well as the
- * content-type if using the upload API.
- *
- * @throws HttpResponseException thrown if the request is rejected by server.
- * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
- * @throws ResourceNotFoundException thrown if 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 list of supported file formats.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public SupportedFileFormats getSupportedFormats() {
- // Generated convenience method for getSupportedFormatsWithResponse
- RequestOptions requestOptions = new RequestOptions();
- return getSupportedFormatsWithResponse(requestOptions).getValue().toObject(SupportedFileFormats.class);
- }
}
diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationAsyncClient.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationAsyncClient.java
index 4b06e2f6b63fb..84c02e035021b 100644
--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationAsyncClient.java
+++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationAsyncClient.java
@@ -82,12 +82,11 @@ public final class SingleDocumentTranslationAsyncClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Mono> documentTranslateWithResponse(String targetLanguage, BinaryData documentTranslateContent,
+ Mono> 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);
}
/**
@@ -119,9 +118,9 @@ Mono> documentTranslateWithResponse(String targetLanguage,
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono documentTranslate(String targetLanguage, DocumentTranslateContent documentTranslateContent,
+ public Mono 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);
@@ -132,7 +131,7 @@ public Mono 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(),
@@ -180,11 +179,10 @@ public Mono documentTranslate(String targetLanguage, DocumentTransla
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono documentTranslate(String targetLanguage,
- DocumentTranslateContent documentTranslateContent) {
- // Generated convenience method for documentTranslateWithResponse
+ public Mono 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(),
diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationClient.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationClient.java
index ddf9235951e00..8f1b193bca8f3 100644
--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationClient.java
+++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationClient.java
@@ -80,12 +80,11 @@ public final class SingleDocumentTranslationClient {
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- Response documentTranslateWithResponse(String targetLanguage, BinaryData documentTranslateContent,
+ Response 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);
}
/**
@@ -117,9 +116,9 @@ Response 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);
@@ -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(),
@@ -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(),
diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java
index cf440221edca8..1381ae4f3d8f4 100644
--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java
+++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java
@@ -5,7 +5,7 @@
package com.azure.ai.translation.document.implementation;
import com.azure.ai.translation.document.DocumentTranslationServiceVersion;
-import com.azure.ai.translation.document.models.TranslationStatus;
+import com.azure.ai.translation.document.models.TranslationStatusResult;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
@@ -177,9 +177,9 @@ public interface DocumentTranslationClientService {
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> startTranslation(@HostParam("endpoint") String endpoint,
+ Mono> beginTranslation(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData startTranslationDetails,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Post("/document/batches")
@@ -188,9 +188,9 @@ Mono> startTranslation(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response startTranslationSync(@HostParam("endpoint") String endpoint,
+ Response beginTranslationSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
- @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData startTranslationDetails,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
RequestOptions requestOptions, Context context);
@Get("/document/batches")
@@ -199,7 +199,7 @@ Response startTranslationSync(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> getTranslationsStatus(@HostParam("endpoint") String endpoint,
+ Mono> listTranslationStatuses(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@@ -209,7 +209,7 @@ Mono> getTranslationsStatus(@HostParam("endpoint") String e
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response getTranslationsStatusSync(@HostParam("endpoint") String endpoint,
+ Response listTranslationStatusesSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@@ -220,7 +220,7 @@ Response getTranslationsStatusSync(@HostParam("endpoint") String end
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getDocumentStatus(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@PathParam("documentId") String documentId, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@@ -231,7 +231,7 @@ Mono> getDocumentStatus(@HostParam("endpoint") String endpo
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getDocumentStatusSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@PathParam("documentId") String documentId, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@@ -242,7 +242,7 @@ Response getDocumentStatusSync(@HostParam("endpoint") String endpoin
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getTranslationStatus(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/document/batches/{id}")
@@ -252,7 +252,7 @@ Mono> getTranslationStatus(@HostParam("endpoint") String en
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getTranslationStatusSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Delete("/document/batches/{id}")
@@ -262,7 +262,7 @@ Response getTranslationStatusSync(@HostParam("endpoint") String endp
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> cancelTranslation(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Delete("/document/batches/{id}")
@@ -272,7 +272,7 @@ Mono> cancelTranslation(@HostParam("endpoint") String endpo
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response cancelTranslationSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/document/batches/{id}/documents")
@@ -281,8 +281,8 @@ Response cancelTranslationSync(@HostParam("endpoint") String endpoin
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> getDocumentsStatus(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ Mono> listDocumentStatuses(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/document/batches/{id}/documents")
@@ -291,8 +291,8 @@ Mono> getDocumentsStatus(@HostParam("endpoint") String endp
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response getDocumentsStatusSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("id") String id,
+ Response listDocumentStatusesSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("id") String translationId,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/document/formats")
@@ -321,7 +321,7 @@ Response getSupportedFormatsSync(@HostParam("endpoint") String endpo
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> getTranslationsStatusNext(
+ Mono> listTranslationStatusesNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@@ -331,7 +331,7 @@ Mono> getTranslationsStatusNext(
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response getTranslationsStatusNextSync(
+ Response listTranslationStatusesNextSync(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@@ -341,7 +341,7 @@ Response getTranslationsStatusNextSync(
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Mono> getDocumentsStatusNext(
+ Mono> listDocumentStatusesNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@@ -351,9 +351,9 @@ Mono> getDocumentsStatusNext(
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
- Response getDocumentsStatusNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
- @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
- Context context);
+ Response listDocumentStatusesNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
}
/**
@@ -417,7 +417,7 @@ Response getDocumentsStatusNextSync(@PathParam(value = "nextLink", e
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -426,13 +426,11 @@ Response getDocumentsStatusNextSync(@PathParam(value = "nextLink", e
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> startTranslationWithResponseAsync(BinaryData startTranslationDetails,
- RequestOptions requestOptions) {
+ private Mono> beginTranslationWithResponseAsync(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.startTranslation(this.getEndpoint(), this.getServiceVersion().getVersion(),
- contentType, accept, startTranslationDetails, requestOptions, context));
+ return FluxUtil.withContext(context -> service.beginTranslation(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context));
}
/**
@@ -496,7 +494,7 @@ private Mono> startTranslationWithResponseAsync(BinaryData startT
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -505,12 +503,11 @@ private Mono> startTranslationWithResponseAsync(BinaryData startT
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Response startTranslationWithResponse(BinaryData startTranslationDetails,
- RequestOptions requestOptions) {
+ private Response beginTranslationWithResponse(BinaryData body, RequestOptions requestOptions) {
final String contentType = "application/json";
final String accept = "application/json";
- return service.startTranslationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
- accept, startTranslationDetails, requestOptions, Context.NONE);
+ return service.beginTranslationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
+ accept, body, requestOptions, Context.NONE);
}
/**
@@ -574,7 +571,7 @@ private Response startTranslationWithResponse(BinaryData startTranslationD
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -583,10 +580,10 @@ private Response startTranslationWithResponse(BinaryData startTranslationD
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux beginStartTranslationAsync(BinaryData startTranslationDetails,
+ public PollerFlux beginBeginTranslationAsync(BinaryData body,
RequestOptions requestOptions) {
return PollerFlux.create(Duration.ofSeconds(1),
- () -> this.startTranslationWithResponseAsync(startTranslationDetails, requestOptions),
+ () -> this.beginTranslationWithResponseAsync(body, requestOptions),
new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
.setEndpoint("{endpoint}/translator".replace("{endpoint}", this.getEndpoint()))
.setContext(requestOptions != null && requestOptions.getContext() != null
@@ -657,7 +654,7 @@ public PollerFlux beginStartTranslationAsync(BinaryData
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -666,10 +663,9 @@ public PollerFlux beginStartTranslationAsync(BinaryData
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller beginStartTranslation(BinaryData startTranslationDetails,
- RequestOptions requestOptions) {
+ public SyncPoller beginBeginTranslation(BinaryData body, RequestOptions requestOptions) {
return SyncPoller.createPoller(Duration.ofSeconds(1),
- () -> this.startTranslationWithResponse(startTranslationDetails, requestOptions),
+ () -> this.beginTranslationWithResponse(body, requestOptions),
new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
.setEndpoint("{endpoint}/translator".replace("{endpoint}", this.getEndpoint()))
.setContext(requestOptions != null && requestOptions.getContext() != null
@@ -740,7 +736,7 @@ public SyncPoller beginStartTranslation(BinaryData start
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -749,18 +745,18 @@ public SyncPoller beginStartTranslation(BinaryData start
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux
- beginStartTranslationWithModelAsync(BinaryData startTranslationDetails, RequestOptions requestOptions) {
+ public PollerFlux
+ beginBeginTranslationWithModelAsync(BinaryData body, RequestOptions requestOptions) {
return PollerFlux.create(Duration.ofSeconds(1),
- () -> this.startTranslationWithResponseAsync(startTranslationDetails, requestOptions),
+ () -> this.beginTranslationWithResponseAsync(body, requestOptions),
new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
.setEndpoint("{endpoint}/translator".replace("{endpoint}", this.getEndpoint()))
.setContext(requestOptions != null && requestOptions.getContext() != null
? requestOptions.getContext()
: Context.NONE)
.setServiceVersion(this.getServiceVersion().getVersion())),
- TypeReference.createInstance(TranslationStatus.class),
- TypeReference.createInstance(TranslationStatus.class));
+ TypeReference.createInstance(TranslationStatusResult.class),
+ TypeReference.createInstance(TranslationStatusResult.class));
}
/**
@@ -824,7 +820,7 @@ public SyncPoller beginStartTranslation(BinaryData start
* }
*
*
- * @param startTranslationDetails Translation job submission batch request.
+ * @param body Translation job submission batch request.
* @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.
@@ -833,18 +829,18 @@ public SyncPoller beginStartTranslation(BinaryData start
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller
- beginStartTranslationWithModel(BinaryData startTranslationDetails, RequestOptions requestOptions) {
+ public SyncPoller beginBeginTranslationWithModel(BinaryData body,
+ RequestOptions requestOptions) {
return SyncPoller.createPoller(Duration.ofSeconds(1),
- () -> this.startTranslationWithResponse(startTranslationDetails, requestOptions),
+ () -> this.beginTranslationWithResponse(body, requestOptions),
new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
.setEndpoint("{endpoint}/translator".replace("{endpoint}", this.getEndpoint()))
.setContext(requestOptions != null && requestOptions.getContext() != null
? requestOptions.getContext()
: Context.NONE)
.setServiceVersion(this.getServiceVersion().getVersion())),
- TypeReference.createInstance(TranslationStatus.class),
- TypeReference.createInstance(TranslationStatus.class));
+ TypeReference.createInstance(TranslationStatusResult.class),
+ TypeReference.createInstance(TranslationStatusResult.class));
}
/**
@@ -996,10 +992,10 @@ public SyncPoller beginStartTranslation(BinaryData start
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getTranslationsStatusSinglePageAsync(RequestOptions requestOptions) {
+ private Mono> listTranslationStatusesSinglePageAsync(RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
- .withContext(context -> service.getTranslationsStatus(this.getEndpoint(),
+ .withContext(context -> service.listTranslationStatuses(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
@@ -1153,7 +1149,7 @@ private Mono> getTranslationsStatusSinglePageAsync(Req
* @return translation job Status Response as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux getTranslationsStatusAsync(RequestOptions requestOptions) {
+ public PagedFlux listTranslationStatusesAsync(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
@@ -1166,7 +1162,7 @@ public PagedFlux getTranslationsStatusAsync(RequestOptions requestOp
requestLocal.setUrl(urlBuilder.toString());
});
}
- return getTranslationsStatusSinglePageAsync(requestOptionsLocal);
+ return listTranslationStatusesSinglePageAsync(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
@@ -1177,7 +1173,7 @@ public PagedFlux getTranslationsStatusAsync(RequestOptions requestOp
requestLocal.setUrl(urlBuilder.toString());
});
}
- return getTranslationsStatusNextSinglePageAsync(nextLink, requestOptionsLocal);
+ return listTranslationStatusesNextSinglePageAsync(nextLink, requestOptionsLocal);
});
}
@@ -1329,9 +1325,9 @@ public PagedFlux getTranslationsStatusAsync(RequestOptions requestOp
* @return translation job Status Response along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private PagedResponse getTranslationsStatusSinglePage(RequestOptions requestOptions) {
+ private PagedResponse listTranslationStatusesSinglePage(RequestOptions requestOptions) {
final String accept = "application/json";
- Response res = service.getTranslationsStatusSync(this.getEndpoint(),
+ Response res = service.listTranslationStatusesSync(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
@@ -1485,7 +1481,7 @@ private PagedResponse getTranslationsStatusSinglePage(RequestOptions
* @return translation job Status Response as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable getTranslationsStatus(RequestOptions requestOptions) {
+ public PagedIterable listTranslationStatuses(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
@@ -1498,7 +1494,7 @@ public PagedIterable getTranslationsStatus(RequestOptions requestOpt
requestLocal.setUrl(urlBuilder.toString());
});
}
- return getTranslationsStatusSinglePage(requestOptionsLocal);
+ return listTranslationStatusesSinglePage(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
@@ -1509,7 +1505,7 @@ public PagedIterable getTranslationsStatus(RequestOptions requestOpt
requestLocal.setUrl(urlBuilder.toString());
});
}
- return getTranslationsStatusNextSinglePage(nextLink, requestOptionsLocal);
+ return listTranslationStatusesNextSinglePage(nextLink, requestOptionsLocal);
});
}
@@ -1547,7 +1543,7 @@ public PagedIterable getTranslationsStatus(RequestOptions requestOpt
* }
*
*
- * @param id Format - uuid. The batch id.
+ * @param translationId Format - uuid. The batch id.
* @param documentId Format - uuid. The document id.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
@@ -1557,11 +1553,11 @@ public PagedIterable getTranslationsStatus(RequestOptions requestOpt
* @return document Status Response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> getDocumentStatusWithResponseAsync(String id, String documentId,
+ public Mono> getDocumentStatusWithResponseAsync(String translationId, String documentId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.getDocumentStatus(this.getEndpoint(),
- this.getServiceVersion().getVersion(), id, documentId, accept, requestOptions, context));
+ this.getServiceVersion().getVersion(), translationId, documentId, accept, requestOptions, context));
}
/**
@@ -1598,7 +1594,7 @@ public Mono> getDocumentStatusWithResponseAsync(String id,
* }
*
*
- * @param id Format - uuid. The batch id.
+ * @param translationId Format - uuid. The batch id.
* @param documentId Format - uuid. The document id.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
@@ -1608,11 +1604,11 @@ public Mono> getDocumentStatusWithResponseAsync(String id,
* @return document Status Response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getDocumentStatusWithResponse(String id, String documentId,
+ public Response getDocumentStatusWithResponse(String translationId, String documentId,
RequestOptions requestOptions) {
final String accept = "application/json";
- return service.getDocumentStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, documentId,
- accept, requestOptions, Context.NONE);
+ return service.getDocumentStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), translationId,
+ documentId, accept, requestOptions, Context.NONE);
}
/**
@@ -1655,7 +1651,7 @@ public Response getDocumentStatusWithResponse(String id, String docu
* }
*
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -1664,10 +1660,11 @@ public Response getDocumentStatusWithResponse(String id, String docu
* @return translation job status response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> getTranslationStatusWithResponseAsync(String id, RequestOptions requestOptions) {
+ public Mono> getTranslationStatusWithResponseAsync(String translationId,
+ RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.getTranslationStatus(this.getEndpoint(),
- this.getServiceVersion().getVersion(), id, accept, requestOptions, context));
+ this.getServiceVersion().getVersion(), translationId, accept, requestOptions, context));
}
/**
@@ -1710,7 +1707,7 @@ public Mono> getTranslationStatusWithResponseAsync(String i
* }
*
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -1719,10 +1716,10 @@ public Mono> getTranslationStatusWithResponseAsync(String i
* @return translation job status response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getTranslationStatusWithResponse(String id, RequestOptions requestOptions) {
+ public Response getTranslationStatusWithResponse(String translationId, RequestOptions requestOptions) {
final String accept = "application/json";
- return service.getTranslationStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, accept,
- requestOptions, Context.NONE);
+ return service.getTranslationStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ translationId, accept, requestOptions, Context.NONE);
}
/**
@@ -1769,7 +1766,7 @@ public Response getTranslationStatusWithResponse(String id, RequestO
* }
*
*
- * @param id Format - uuid. The operation-id.
+ * @param translationId Format - uuid. The operation-id.
* @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.
@@ -1778,10 +1775,11 @@ public Response getTranslationStatusWithResponse(String id, RequestO
* @return translation job status response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> cancelTranslationWithResponseAsync(String id, RequestOptions requestOptions) {
+ public Mono> cancelTranslationWithResponseAsync(String translationId,
+ RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.cancelTranslation(this.getEndpoint(),
- this.getServiceVersion().getVersion(), id, accept, requestOptions, context));
+ this.getServiceVersion().getVersion(), translationId, accept, requestOptions, context));
}
/**
@@ -1828,7 +1826,7 @@ public Mono> cancelTranslationWithResponseAsync(String id,
* }
*
*
- * @param id Format - uuid. The operation-id.
+ * @param translationId Format - uuid. The operation-id.
* @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.
@@ -1837,10 +1835,10 @@ public Mono> cancelTranslationWithResponseAsync(String id,
* @return translation job status response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response cancelTranslationWithResponse(String id, RequestOptions requestOptions) {
+ public Response cancelTranslationWithResponse(String translationId, RequestOptions requestOptions) {
final String accept = "application/json";
- return service.cancelTranslationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), id, accept,
- requestOptions, Context.NONE);
+ return service.cancelTranslationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), translationId,
+ accept, requestOptions, Context.NONE);
}
/**
@@ -1973,7 +1971,7 @@ public Response cancelTranslationWithResponse(String id, RequestOpti
* }
*
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -1982,12 +1980,12 @@ public Response cancelTranslationWithResponse(String id, RequestOpti
* @return documents Status Response along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getDocumentsStatusSinglePageAsync(String id,
+ private Mono> listDocumentStatusesSinglePageAsync(String translationId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
- .withContext(context -> service.getDocumentsStatus(this.getEndpoint(),
- this.getServiceVersion().getVersion(), id, accept, requestOptions, context))
+ .withContext(context -> service.listDocumentStatuses(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), translationId, accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
@@ -2122,7 +2120,7 @@ private Mono> getDocumentsStatusSinglePageAsync(String
* }
*
*
- * @param id Format - uuid. The operation id.
+ * @param translationId Format - uuid. The operation id.
* @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.
@@ -2131,7 +2129,7 @@ private Mono