Skip to content

Latest commit

 

History

History
248 lines (173 loc) · 4.89 KB

4.x.x to 5.x.x.md

File metadata and controls

248 lines (173 loc) · 4.89 KB

Upgrading from 4.x.x to 5.x.x

Follow the General changes to see the changes that are package indenpendent. Also refer to the Box.V2 or Box.V2.Core section depending on the package you are using.

General changes

Removed deprecated methods

Some old, deprecated methods have been removed from version 5.x.x. Read this section further to see a new, alternative methods.

BoxMetadataManager/IBoxMetadataManager

//Old
ExecuteMetadataQueryAsync(string from, string ancestorFolderId, IEnumerable<string> fields, string query, Dictionary<string, object> queryParameters, string indexName, List<BoxMetadataQueryOrderBy> orderBy, int limit, string marker, bool autoPaginate)

ExecuteMetadataQueryAsync(string from, string ancestorFolderId, string query = null, Dictionary<string, object> queryParameters = null, string indexName = null, List<BoxMetadataQueryOrderBy> orderBy = null, int limit = 100, string marker = null, bool autoPaginate = false)

//New
ExecuteMetadataQueryAsync(BoxMetadataQueryRequest queryRequest)

BoxConfigBuilder/IBoxConfigBuilder

//Old
SetBoxApiUri(...)
SetBoxTokenApiUri(...)

//New
SetBoxApiHostUri(...)

BoxFilesManager/IBoxFilesManager

//Old
DownloadStreamAsync(...)

//New
DownloadAsync(...)
//Old
UploadFileVersionUsingSessionAsync(...)

//New 
UploadNewVersionUsingSessionAsync(...)
//Old
GetCollaborationsAsync(...)

//New
GetCollaborationsCollectionAsync(...)
//Old
GetFilePreviewAsync(...)
GetPreviewAsync(...)

//New
GetPreviewLinkAsync(...)

BoxSearchManager/IBoxSearchManager

//Old
SearchAsync(...)

//New
QueryAsync(...)

BoxFolderManager/IBoxFolderManager

//Old
GetTrashItemsAsync(string id, int limit, int offset = 0, IEnumerable<string> fields = null)

//New
GetTrashItemsAsync(int limit, int offset = 0, IEnumerable<string> fields = null, bool autoPaginate = false, string sort = null, BoxSortDirection? direction = null)
//Old
GetItemsAsync(...)

//New
GetFolderItemsAsync(...)

BoxTermsOfServiceManager/IBoxTermsOfServiceManager

//Old
CreateBoxTermsOfServiceUserStatusesAsync(BoxTermsOfServiceUserStatusesRequest termsOfServicesUserStatusesRequest)

//New
CreateBoxTermsOfServiceUserStatusesAsync(BoxTermsOfServiceUserStatusCreateRequest termsOfServiceUserStatusCreateRequest)

OAuthSession

//Old
OAuthSession(string access_token, string refresh_token, int expires_in, string token_type, AuthVersion authVersion)

//New
OAuthSession(string access_token, string refresh_token, int expires_in, string token_type)

BoxRetentionPoliciesManager/IBoxRetentionPoliciesManager

//Old
Task<BoxCollectionMarkerBased<BoxFileVersion>> GetFileVersionsUnderRetentionForAssignmentAsync(...)

//New
Task<BoxCollectionMarkerBased<BoxFile>> GetFileVersionsUnderRetentionForAssignmentAsync(...)

Deprecated fields

Some old, deprecated fields have been removed from version 5.x.x. Read this section further to see a new, alternative fields.

BoxConfigBuilder/IBoxConfigBuilder

//Old
BoxAuthTokenApiUri

//New
BoxApiHostUri

Constants

//Old
MasterInviteAccept

//New
AdminInviteAccept
//Old
MasterInviteReject

//New
AdminInviteReject
//Old
V1AuthString

//New
//V1 Auth is no longer support in the API.

IBoxConfig

//Old
BoxAuthTokenApiUri

//New
BoxApiHostUri

BoxPermissionsRequest

//Old
BoxPermissionType? Preview

//New
//Deprecated field. Value is always true 

OAuthSession

//Old
AuthVersion

//New
//Box API have now one auth version so there is no need to differentiate between them.

BoxFileVersion

//Old
BoxFileVersion

//New
//No alternative as this field was used only in GetFileVersionsUnderRetentionForAssignmentAsync(...).
//This method now returns proper BoxFile object instead.

Box.V2

Minimal .NET runtime version upgrade

If you are still using .NET Framework version lower than 4.6.2 you need to upgrade to the 4.6.2+ version. You can do it by changing target framework in the .csproj file of your project.

For SDK-style projects

Before

<TargetFramework>net45<TargetFramework/>

After

<TargetFramework>net462<TargetFramework/>

See SDK-style target framework for more information.

For non SDK-style projects

Before

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

After

<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>

See MSBuild target framework for more information

We recommend to upgrade to the newest version possible. See .NET Framework lifecycle

Box.V2.Core

No changes