Skip to content

[Translation] Regenerate azure-ai-translation-document from 2026-03-01 spec (GA 2.0.0)#49736

Open
jrjrguo wants to merge 4 commits into
Azure:mainfrom
jrjrguo:translation/document-2026-03-01-regen
Open

[Translation] Regenerate azure-ai-translation-document from 2026-03-01 spec (GA 2.0.0)#49736
jrjrguo wants to merge 4 commits into
Azure:mainfrom
jrjrguo:translation/document-2026-03-01-regen

Conversation

@jrjrguo

@jrjrguo jrjrguo commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Regenerates the Document Translation SDK (azure-ai-translation-document) from the 2026-03-01 service 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

  • Add DocumentTranslationServiceVersion.V2026_03_01 (now the latest/default).
  • Custom deployment name:
    • TranslationTarget.deploymentName
    • DocumentStatusResult.deploymentName
    • deploymentName parameter on SingleDocumentTranslationClient / SingleDocumentTranslationAsyncClient.translate(...)
  • Image translation:
    • New BatchOptions model (translateTextWithinImage) with TranslationBatch.options
    • translateTextWithinImage parameter on translate(...)
    • Image scan reporting on DocumentStatusResult (imageCharacterDetected, imageCharged, totalImageScansSucceeded, totalImageScansFailed) and TranslationStatusSummary (totalImageScansSucceeded, totalImageScansFailed, totalImagesChargedCount)
  • Update tsp-location.yaml to the 2026-03-01 spec commit (53145470), which drops the Java emitter api-version pin so the SDK defaults to the latest version.
  • Bump version to 2.0.0 and update CHANGELOG.md.
  • Add custom model and image translation samples plus README example sections.
  • Add serialization unit tests for the new fields.

Breaking Changes

  • Added deploymentName and translateTextWithinImage parameters to the translate(...) convenience methods (major version bump to 2.0.0).

Verification

  • mvn compile / test-compile succeed.
  • 0 Checkstyle violations, SpotBugs passes.
  • README code snippets verified.
  • New serialization unit tests pass.

Notes

  • Recorded/playback tests still need to be re-recorded against the 2026-03-01 API version; that will be handled separately.

…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.
Copilot AI review requested due to automatic review settings July 7, 2026 01:48
@jrjrguo jrjrguo requested review from a team and zhangeugenia as code owners July 7, 2026 01:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread sdk/translation/azure-ai-translation-document/CHANGELOG.md Outdated
Jiarui Guo 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants