diff --git a/.codegen.json b/.codegen.json index c1132aff1..6c77d7b24 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "91b0f90", "specHash": "ec8720b", "version": "0.1.0" } +{ "engineHash": "ee8dfc8", "specHash": "ec8720b", "version": "0.1.0" } diff --git a/README.md b/README.md index af8e807a2..3541ca3df 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Browse the [docs](docs/README.md) or see [API Reference](https://developer.box.c # Upgrades -The SDK is updated regularly to include new features, enhancements, and bug fixes. If you are upgrading from manual SDK to this new generated SDK checkout the [migration guide](MIGRATION_GUIDE.md) and [changelog](CHANGELOG.md) for more information. +The SDK is updated regularly to include new features, enhancements, and bug fixes. If you are upgrading from manual SDK to this new generated SDK checkout the [migration guide](migration-guides/from-v4-to-v10.md) and [changelog](CHANGELOG.md) for more information. # Integration Tests diff --git a/migration-guides/from-box-java-sdk-gen-v0-to-box-java-sdk-v10.md b/migration-guides/from-box-java-sdk-gen-v0-to-box-java-sdk-v10.md new file mode 100644 index 000000000..465f55047 --- /dev/null +++ b/migration-guides/from-box-java-sdk-gen-v0-to-box-java-sdk-v10.md @@ -0,0 +1,148 @@ +# Migration guide from beta release (v0.8.0) of the `box-java-sdk-gen` to the v10 version of the `box-java-sdk` + + + + +- [Installation](#installation) + - [How to migrate](#how-to-migrate) + - [Maven](#maven) + - [Gradle](#gradle) +- [Union classes name changes](#union-classes-name-changes) + - [How to migrate](#how-to-migrate-1) +- [Removed unused models from schemas namespace](#removed-unused-models-from-schemas-namespace) + - [How to migrate](#how-to-migrate-2) + + + +## Installation + +In order to start using v10 version of the Box Java SDK, you need to change the dependency in your project. +The artifact name has changed from `com.box:box-java-sdk-gen` to `com.box:box-java-sdk`. +You also need to set the version to `10.0.0` or higher. You can find the latest version on [Maven Central](https://search.maven.org/artifact/com.box/box-java-sdk). + +### How to migrate + +#### Maven + +To start using v10 version of Box Java SDK in your Maven project replace the dependency in your `pom.xml` file. + +**Old (`box-java-sdk-gen-v0`)** + +```xml + + com.box + box-java-sdk-gen + 0.8.0 + +``` + +**New (`box-java-sdk-v10`)** + +```xml + + com.box + box-java-sdk + 10.0.0 + +``` + +#### Gradle + +To start using v10 version of Box Java SDK in your Gradle project replace the dependency in your `build.gradle` file. + +**Old (`box-java-sdk-gen-v0`)** + +```groovy +implementation 'com.box:box-java-sdk-gen:0.8.0' +``` + +**New (`box-java-sdk-v10`)** + +```groovy +implementation 'com.box:box-java-sdk:10.0.0' +``` + +## Union classes name changes + +In the beta version of the `box-java-sdk-gen` our `OneOf` class names (representing unions from the OpenAPI specification) +were fully auto-generated based on the included variants. This often resulted in overly long names that were difficult +to work with in tools like Git. For example: `MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString`. +Additionally, every time the new variant was added to the `OneOf`, the class name itself changed. +Starting in v10, the names of `OneOf` classes are defined directly in the specification. This ensures that they are meaningful, short, and stable over time. + +### How to migrate + +If your code references any of the renamed classes, replace the old name with the new one. +If you were not explicitly using the type names, no changes are needed, since only the class names changed and their behavior remains the same. + +List of changed `OneOf` classes and types associated with them: + +| Old name | New name | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ | +| AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen | AiAgent | +| AiAgentAskOrAiAgentReference | AiAskAgent | +| AiAgentExtractOrAiAgentReference | AiExtractAgent | +| AiAgentExtractStructuredOrAiAgentReference | AiExtractStructuredAgent | +| AiAgentReferenceOrAiAgentTextGen | AiTextGenAgent | +| AppItemEventSourceOrEventSourceOrFileOrFolderOrGenericSourceOrUser | EventSourceResource | +| FileBaseOrFolderBaseOrWebLinkBase | AppItemAssociatedItem | +| FileFullOrFolderFull | MetadataQueryResultItem | +| FileFullOrFolderFullOrWebLink | SearchResultWithSharedLinkItem/RecentItemResource/SearchResultItem | +| FileFullOrFolderMiniOrWebLink | Item | +| FileMiniOrFolderMini | Resource | +| FileOrFolderOrWebLink | LegalHoldPolicyAssignedItem/CollaborationItem | +| FileOrFolderScope | ResourceScope | +| FileReferenceOrFolderReferenceOrWeblinkReferenceV2025R0 | HubItemReferenceV2025R0 | +| GroupMiniOrUserCollaborations | CollaborationAccessGrantee | +| IntegrationMappingPartnerItemSlackUnion | IntegrationMappingPartnerItemSlack | +| IntegrationMappingPartnerItemTeamsUnion | IntegrationMappingPartnerItemTeams | +| KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard | SkillCard | +| MetadataFieldFilterDateRangeOrMetadataFieldFilterFloatRangeOrArrayOfStringOrNumberOrString | MetadataFilterValue | +| SearchResultsOrSearchResultsWithSharedLinks | SearchResultsResponse | + +Some classes were split into multiple ones depending on context. + +Manager functions affected by these changes: + +| Function | Old return type | New return type | +| -------------------------------------- | -------------------------------------------------------------------- | --------------------- | +| AiManager.getAiAgentDefaultConfig(...) | AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen | AiAgent | +| SearchManager.searchForContent(...) | SearchResultsOrSearchResultsWithSharedLinks | SearchResultsResponse | + +## Removed unused models from schemas namespace + +Several unused types (classes and enums) have been removed from the schemas because they were not used by any SDK functions or by the Box API. + +### How to migrate + +Here is the full list of removed types: + +| Removed classes/enums | +| ------------------------------------------ | +| FileOrFolder | +| HubActionV2025R0 | +| MetadataQueryIndex | +| MetadataQueryIndexFieldsField | +| MetadataQueryIndexFieldsSortDirectionField | +| MetadataQueryIndexStatusField | +| RetentionPolicyAssignmentBase | +| RetentionPolicyAssignmentBaseTypeField | +| SkillInvocation | +| SkillInvocationEnterpriseField | +| SkillInvocationEnterpriseTypeField | +| SkillInvocationSkillField | +| SkillInvocationSkillTypeField | +| SkillInvocationStatusField | +| SkillInvocationStatusStateField | +| SkillInvocationTokenField | +| SkillInvocationTokenReadField | +| SkillInvocationTokenReadTokenTypeField | +| SkillInvocationTokenWriteField | +| SkillInvocationTokenWriteTokenTypeField | +| SkillInvocationTypeField | +| WebhookInvocation | +| WebhookInvocationTriggerField | +| WebhookInvocationTypeField | +| WorkflowFull | + +If your code references any of these types, remove those references. diff --git a/migration-guide.md b/migration-guides/from-v4-to-v10.md similarity index 100% rename from migration-guide.md rename to migration-guides/from-v4-to-v10.md