Vonage / vonage-java-sdk

Vonage Server SDK for Java. API support for SMS, Messages, Voice, Text-to-Speech, Numbers, Verify (2FA), Video and more.
https://developer.vonage.com/en/home
Apache License 2.0
97 stars 121 forks source link

refactor: Type inference hack for fromJson #492

Closed SMadani closed 11 months ago

SMadani commented 11 months ago

This PR adds documentation to the Jsonable class, as well as an overload to infer the type using the varargs trick. It also removes the unused VonageApiResponseException.fromHttpResponse method, and standardises MessageStatus.fromJson.

codecov-commenter commented 11 months ago

Codecov Report

Merging #492 (8718d8a) into main (80a4cdc) will increase coverage by 0.05%. Report is 1 commits behind head on main. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main     #492      +/-   ##
============================================
+ Coverage     93.90%   93.95%   +0.05%     
+ Complexity     2593     2592       -1     
============================================
  Files           380      380              
  Lines          6532     6521      -11     
  Branches        431      430       -1     
============================================
- Hits           6134     6127       -7     
+ Misses          224      218       -6     
- Partials        174      176       +2     
Files Coverage Δ
src/main/java/com/vonage/client/Jsonable.java 91.30% <100.00%> (+9.48%) :arrow_up:
.../com/vonage/client/VonageApiResponseException.java 67.39% <100.00%> (+0.72%) :arrow_up:
...ava/com/vonage/client/account/BalanceResponse.java 100.00% <100.00%> (ø)
...com/vonage/client/account/ListSecretsResponse.java 100.00% <100.00%> (ø)
...m/vonage/client/account/PrefixPricingResponse.java 100.00% <100.00%> (ø)
...ava/com/vonage/client/account/PricingResponse.java 100.00% <100.00%> (ø)
...java/com/vonage/client/account/SecretResponse.java 100.00% <100.00%> (ø)
...va/com/vonage/client/account/SettingsResponse.java 100.00% <100.00%> (ø)
...ava/com/vonage/client/application/Application.java 93.75% <100.00%> (ø)
...com/vonage/client/application/ApplicationList.java 75.00% <100.00%> (ø)
... and 45 more

... and 1 file with indirect coverage changes