Created by: lucamazzanti
It tries to reduce the number of constructors introduced in previous PR. Related to: #9060 (closed), #9085
Refactor on constructors
In the previous PM I created too much constructors. This is an emprovement to reduce them:
- I kept the HttpClient service as first parameter when available in signature
- Then the configurations
- Then the optional HttpClientHandler
With this PM we have in ApliClient:
- ctor()
- ctor(string basePath)
- ctor(HttpClient client, HttpClientHandler handler = null)
- ctor(HttpClient client, string basePath, HttpClientHandler handler = null)
(point 1-2 marked as obsolete) and in ApiClass:
- ctor()
- ctor(string basePath)
- ctor(Configuration configuration)
- ctor(HttpClient client, HttpClientHandler handler = null)
- ctor(HttpClient client, string basePath, HttpClientHandler handler = null)
- ctor(HttpClient client, Configuration configuration, HttpClientHandler handler = null)
- ctor(ISynchronousClient client, IAsynchronousClient asyncClient, IReadableConfiguration configuration)
(point 1-3 marked as obsolete)
Obsolete constructors
Marked constructors without the explicit HttpClient parameter as obsolete.
Spaces and indentations
Unfortunatly I had a different setup for spaces and indentations on my IDE and I did not see it on my local versioning tool. So the changes have some spaces because I fixed my previous PM, moving some tabs to 4 spaces. They are a few lines not so much, but this is why you see some noise in the diffs, its a fix to keep and I will avoid it at all in the future.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
,5.1.x
,6.0.x
-
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
@mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03)