[Translation] Regenerate azure-ai-translation-document from 2026-03-01 spec (GA 2.0.0)#49736
Open
jrjrguo wants to merge 4 commits into
Open
[Translation] Regenerate azure-ai-translation-document from 2026-03-01 spec (GA 2.0.0)#49736jrjrguo wants to merge 4 commits into
jrjrguo wants to merge 4 commits into
Conversation
…1 spec (GA 2.0.0) Regenerate the Document Translation SDK from the 2026-03-01 service API version and release it as GA 2.0.0. Changes (scoped to image translation and custom deployment name): - Add DocumentTranslationServiceVersion.V2026_03_01 (now the latest/default). - Custom deployment name: TranslationTarget.deploymentName, DocumentStatusResult.deploymentName, and a deploymentName parameter on SingleDocumentTranslationClient/AsyncClient.translate(...). - Image translation: new BatchOptions model (translateTextWithinImage) with TranslationBatch.options; a translateTextWithinImage parameter on translate(...); image scan reporting on DocumentStatusResult (imageCharacterDetected, imageCharged, totalImageScansSucceeded/Failed) and TranslationStatusSummary (totalImageScansSucceeded/Failed, totalImagesChargedCount). - Update tsp-location.yaml to the 2026-03-01 spec commit. - Bump version to 2.0.0 and update CHANGELOG. - Add custom model and image translation samples plus README examples. - Add serialization unit tests for the new fields. Note: recorded tests will be updated separately.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR regenerates the azure-ai-translation-document library from the 2026-03-01 Document Translation spec and ships it as GA 2.0.0, adding support for custom model deployment names and image-translation options/metrics while making 2026-03-01 the default service version.
Changes:
- Updates the default service version to
2026-03-01(DocumentTranslationServiceVersion.V2026_03_01) and refreshes generated clients/models/metadata accordingly. - Adds new API surface for custom model deployment name and image translation (
BatchOptions,TranslationBatch.options, new usage fields on status models, updated single-document convenience methods). - Updates package versioning and documentation (POM/versioning file/README/CHANGELOG) and adds serialization unit tests + new samples.
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/translation/azure-ai-translation-document/tsp-location.yaml | Pins TypeSpec input to the 2026-03-01 spec commit. |
| sdk/translation/azure-ai-translation-document/src/test/java/com/azure/ai/translation/document/DocumentTranslationModelTests.java | Adds unit tests for JSON (de)serialization of new fields/options. |
| sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/TranslateWithImageTranslation.java | New sample demonstrating image translation enablement + usage reporting. |
| sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/TranslateWithCustomModel.java | New sample demonstrating custom model deployment name (batch + single doc). |
| sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/generated/TranslateASingleDocument.java | Updates generated sample to new translate(...) signature (needs correction to avoid null required args and misleading deployment name). |
| sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/generated/SubmitADocumentTranslationRequestToTheDocumentTranslationService.java | Updates generated batch sample to include deploymentName + BatchOptions (deploymentName placeholder should be clarified). |
| sdk/translation/azure-ai-translation-document/src/main/resources/META-INF/azure-ai-translation-document_metadata.json | Refreshes metadata for new API version and newly generated models. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationClient.java | Updates single-doc convenience overloads to include deploymentName and translateTextWithinImage. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationAsyncClient.java | Async equivalent of single-doc convenience overload updates. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/models/TranslationTarget.java | Adds deploymentName to targets (custom model selection). |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/models/TranslationStatusSummary.java | Adds image scan total fields (with minor Javadoc wording issue). |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/models/TranslationBatch.java | Adds options to batch request and switches to @Fluent. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/models/DocumentStatusResult.java | Adds image usage fields + deploymentName to per-document status (with minor Javadoc wording issue). |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/models/BatchOptions.java | New model to enable translateTextWithinImage. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/SingleDocumentTranslationClientImpl.java | Updates implementation docs to include new query parameters. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java | Regenerated REST proxy code + schema docs reflecting new fields/options. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationServiceVersion.java | Adds V2026_03_01 and makes it the default/latest. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationClient.java | Updates public client schema docs for new request/response fields. |
| sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/DocumentTranslationAsyncClient.java | Updates public async client schema docs for new request/response fields. |
| sdk/translation/azure-ai-translation-document/README.md | Documents custom model + image translation with new snippet sections and sample links. |
| sdk/translation/azure-ai-translation-document/pom.xml | Bumps package version to 2.0.0. |
| sdk/translation/azure-ai-translation-document/CHANGELOG.md | Adds 2.0.0 release notes (breaking-change line needs more precise wording). |
| eng/versioning/version_client.txt | Updates version tracking to 2.0.0. |
added 3 commits
July 6, 2026 22:52
…tion) for .NET parity Add beginTranslation(List<DocumentTranslationInput>, Boolean) to DocumentTranslationClient and DocumentTranslationAsyncClient so callers can enable batch image translation without constructing a TranslationBatch/BatchOptions, matching the .NET StartTranslation(inputs, translateTextWithinImage) convenience. Update the image translation sample/README to use it, add a live test, and update the CHANGELOG.
- Re-record all recorded tests live against the 2026-03-01 service version and update the assets.json tag. - Add testSingleSourceSingleTargetWithImageTranslation exercising the batch beginTranslation(inputs, translateTextWithinImage) convenience overload with a document that embeds an image (test-doc-image.docx), plus a createSourceContainerFromFile helper to upload binary test files. - Delete testContainerWithSupportedAndUnsupportedFiles and testClientCannotAuthenticateWithFakeApiKey: at 2026-03-01 image formats (e.g. .jpg) are supported so the unsupported-file scenario no longer applies, and the fake-endpoint auth test now returns 404 rather than 401.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Regenerates the Document Translation SDK (
azure-ai-translation-document) from the2026-03-01service API version and releases it as GA 2.0.0. This mirrors the .NET change in Azure/azure-sdk-for-net#60219 and consumes the spec from Azure/azure-rest-api-specs#41433.Changes are scoped to the two new features: image translation and custom deployment name.
Changes
DocumentTranslationServiceVersion.V2026_03_01(now the latest/default).TranslationTarget.deploymentNameDocumentStatusResult.deploymentNamedeploymentNameparameter onSingleDocumentTranslationClient/SingleDocumentTranslationAsyncClient.translate(...)BatchOptionsmodel (translateTextWithinImage) withTranslationBatch.optionstranslateTextWithinImageparameter ontranslate(...)DocumentStatusResult(imageCharacterDetected,imageCharged,totalImageScansSucceeded,totalImageScansFailed) andTranslationStatusSummary(totalImageScansSucceeded,totalImageScansFailed,totalImagesChargedCount)tsp-location.yamlto the2026-03-01spec commit (53145470), which drops the Java emitterapi-versionpin so the SDK defaults to the latest version.2.0.0and updateCHANGELOG.md.Breaking Changes
deploymentNameandtranslateTextWithinImageparameters to thetranslate(...)convenience methods (major version bump to 2.0.0).Verification
mvn compile/test-compilesucceed.Notes
2026-03-01API version; that will be handled separately.