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

Allow to set headers and parameters in all requests #318

Merged
merged 2 commits into from
Jul 16, 2020
Merged

Conversation

lbalmaceda
Copy link
Contributor

Changes

All the methods of both API clients now return a request instance that supports being set headers and additional parameters, without the need of casting them to a different class.

  • Methods returning Request now return ParameterizableRequest, exposing both customization methods. This fixes the use case for all the UsersAPIClient and 40% of the AuthenticationAPIClient.
  • Adds a new interface AuthRequest that extends the existing AuthenticationRequest, which already supported adding parameters, and now supports adding headers.
  • DelegationRequest, SignUpRequest, and ProfileRequest got these methods added.
  • SignUpRequest and ProfileRequest got the existing constructor deprecated to signal that when used, the headers are not customizable. They were only used internally on 3 occasions across the AuthenticationAPIClient class.

There are code formatting changes among the diff, apologies in advance if that generates noise.

References

#314 / ESD-7306

Testing

  • This change adds unit test coverage

  • This change adds integration test coverage

  • This change has been tested on the latest version of the platform/language or why not

Checklist

@lbalmaceda lbalmaceda added this to the v1-Next milestone Jul 15, 2020
@lbalmaceda lbalmaceda requested a review from a team July 15, 2020 21:56
@jimmyjames jimmyjames requested review from jimmyjames and removed request for a team July 16, 2020 13:45
@lbalmaceda lbalmaceda merged commit 69c0504 into master Jul 16, 2020
@lbalmaceda lbalmaceda modified the milestones: v1-Next, 1.24.0 Jul 16, 2020
@lbalmaceda lbalmaceda deleted the requests-args branch December 3, 2020 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants