Generating from latest spec + JDK TimeZone type#48319
Open
jpalvarezl wants to merge 3 commits intomainfrom
Open
Generating from latest spec + JDK TimeZone type#48319jpalvarezl wants to merge 3 commits intomainfrom
jpalvarezl wants to merge 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Azure AI Agents/Projects SDKs to regenerate from a newer azure-rest-api-specs commit, while improving type-safety around preview feature opt-in keys and switching several model timezone fields from String to java.util.TimeZone (with accompanying serialization tests).
Changes:
- Bump
tsp-location.yamlcommits to generate from a newer spec revision. - Replace several
Stringtimezone properties withTimeZoneand update JSON (de)serialization accordingly. - Refactor feature opt-in key types from
ExpandableStringEnumto closed Javaenum, and add/extend serialization tests.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/azure-ai-projects/tsp-location.yaml | Updates the spec commit used for generation. |
| sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java | Changes timeZone to TimeZone and serializes as timezone ID. |
| sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/models/RecurrenceTriggerSerializationTest.java | Adds timezone serialization/deserialization tests for RecurrenceTrigger. |
| sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java | Refactors opt-in keys to a closed Java enum. |
| sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CodeBasedEvaluatorDefinition.java | Adjusts model shape (adds entry_point/image_tag) and changes construction pattern. |
| sdk/ai/azure-ai-agents/tsp-location.yaml | Updates the spec commit used for generation. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApproximateLocation.java | Changes timezone to TimeZone and serializes as timezone ID. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java | Changes timezone to TimeZone and serializes as timezone ID. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ApproximateLocationSerializationTests.java | Adds timezone serialization/deserialization tests for ApproximateLocation. |
| sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/WebSearchApproximateLocationSerializationTests.java | Adds timezone serialization/deserialization tests for WebSearchApproximateLocation. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java | Refactors opt-in keys to a closed Java enum. |
| sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java | Refactors opt-in keys to a closed Java enum. |
sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApproximateLocation.java
Show resolved
Hide resolved
...ure-ai-projects/src/main/java/com/azure/ai/projects/models/CodeBasedEvaluatorDefinition.java
Show resolved
Hide resolved
...azure-ai-agents/src/test/java/com/azure/ai/agents/ApproximateLocationSerializationTests.java
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApproximateLocation.java
Outdated
Show resolved
Hide resolved
...i/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java
Show resolved
Hide resolved
...-projects/src/test/java/com/azure/ai/projects/models/RecurrenceTriggerSerializationTest.java
Show resolved
Hide resolved
...agents/src/test/java/com/azure/ai/agents/WebSearchApproximateLocationSerializationTests.java
Show resolved
Hide resolved
sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java
Outdated
Show resolved
Hide resolved
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
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.
This pull request introduces several important improvements to the Azure AI Agents SDK, focusing on stronger type safety for feature opt-in keys and enhanced handling of time zones in location models. It replaces string-based enums with Java enum types for opt-in keys, updates the
ApproximateLocationandWebSearchApproximateLocationmodels to useTimeZoneobjects instead of strings, and adds comprehensive tests to ensure correct serialization and deserialization of time zones.Type Safety and Enum Refactoring:
AgentDefinitionOptInKeysandFoundryFeaturesOptInKeysfromExpandableStringEnum-based classes to standard Javaenumtypes, improving type safety and simplifying usage. Both now include afromStringmethod for parsing and atoStringoverride for serialization. [1] [2]TimeZone Handling in Location Models:
timezoneproperty inApproximateLocationandWebSearchApproximateLocationfromStringtoTimeZone. Updated getter/setter methods, JSON serialization (writes the timezone ID), and deserialization (parses the timezone ID into aTimeZoneobject). [1] [2] [3] [4] [5] [6] [7] [8]Testing Improvements:
ApproximateLocationSerializationTeststhat thoroughly tests serialization and deserialization of theApproximateLocationmodel with various time zone scenarios, including round-trip tests and edge cases.These changes collectively make the SDK safer, more robust, and easier to use when working with feature opt-in keys and time zone-aware location data.