Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize parameter names and positions. #865

Open
TonyValenti opened this issue Nov 25, 2022 · 1 comment
Open

Standardize parameter names and positions. #865

TonyValenti opened this issue Nov 25, 2022 · 1 comment

Comments

@TonyValenti
Copy link

TonyValenti commented Nov 25, 2022

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

@mwwoda
Copy link
Contributor

mwwoda commented Nov 25, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants