box / box-windows-sdk-v2

Windows SDK for v2 of the Box API. The SDK is built upon .NET Framework 4.5

Home Page:https://developer.box.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standardize parameter names and positions.

TonyValenti opened this issue · comments

Is your feature request related to a problem? Please describe.

Many APIs have similar parameters. For example:

Task<BoxCollection<BoxItem>> GetFolderItemsAsync(string id, int limit, int offset = 0, IEnumerable<string> fields = null, bool autoPaginate = false, string sort = null, BoxSortDirection? direction = null);
Task<BoxCollection<BoxUser>> GetEnterpriseUsersAsync(string filterTerm = null, uint offset = 0u, uint limit = 100u, IEnumerable<string> fields = null, string userType = null, string externalAppUserId = null, bool autoPaginate = false);

You will notice that common parameters, like offset and limit and fields are in different orders and vary by type (int vs uint).

Describe the solution you'd like

These should be standardized and, ideally, an "args" class introduced that allow specifying parameters in any order.
ie:

var Users = await ApiClient.UsersManager.GetEnterpriseUsersAsync(new(){
  Offset = 100,
  Limit = 50,
  Fields: new[]{
                BoxUser.FieldName,
                BoxUser.FieldLogin,
  },
});

Describe alternatives you've considered

It can just be left as-is.

Additional context

None

Hi @TonyValenti
This is a good idea that would simplify and standardize apis across the SDK. Unfortunately, it would involve breaking changes to quite a few public apis. It is something we might consider in the future, but it is not currently on our radar. However, contributions are always welcome!